Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
New System.DateTime()
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01088229
Message ID:
01088373
Views:
9
The code was written for the full framework, but another developer needs to use the class in the compact framework. In the real code the try block has more content than the code I posted, but it was the line I posted that was the offender. The fix is to declare the variable and things work just fine in the compact framework.
Here comes another little twist the code would only cause undesired effects when running on PPC OS 2003 and not when it ran under PPC OS 2005.

Just very odd and I was glad I didn't have to debug it :)

>Einar,
>
>Based on your comments in your other post, I would have to say you should do it the second way (even though I prefer the first) since you (apparently) are either writing one code base for both the compact and full frameworks or writing solely for the compact framework. You said you were seeing strange results with the compact framework. I don't expect that the performance hit is too great and if you want the memory freed quickly, you could do something like this:
>
>System.DateTime dt = new System.DateTime(2004, month, day);
>dt = null;
>
>But even that (I suspect) wouldn't be needed as the variable would lose scope anyway. Hey (thought just occurred), if you're declaring the variable inside the try, isn't its scope limited to the try block?
>
>Anyway...I hope those random thoughts and ramblings help a bit.
>
>Chad
>
>>The questions was: is it bad writing:
>>
>>new System.DateTime(2004, month, day);
>>
>>instead of
>>
>>System.DateTime dt = new System.DateTime(2004, month, day);
>>
>>
>>I am not too worried about the cost of exceptions, because if there is an exception raised I will give the engineers a call and tell them that their widget is giving me incorrect data :)
>>
>>Einar
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform