Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The creature that won't die
Message
 
 
To
25/03/2010 11:48:23
General information
Forum:
Visual FoxPro
Category:
VFP Compiler for .NET
Miscellaneous
Thread ID:
01456123
Message ID:
01457187
Views:
63
>>The AS operator is unintuitive but neat... implicit cast returning a null if it fails? Though, this sounds more like a try-catch "see if this works" code, instead of having an IsA(toObj, tcClass) function. What happens if you try to cast a twice subclassed timer as a timer, do you still get a reference to the original object?
>>
>>>I'd do a bit more type checking in the first one if it was for production - but even as it stands it is safer than the VFP version...
>>
>>And what's unsafe in it?



>
>(1) You're not checking that toObj is actually an object
>(2) You assume you can access it's BASECLASS' property (the empty object doesn't have that property)

Great point.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform