Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The creature that won't die
Message
From
25/03/2010 12:01:49
 
General information
Forum:
Visual FoxPro
Category:
VFP Compiler for .NET
Miscellaneous
Thread ID:
01456123
Message ID:
01457190
Views:
62
>>>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.

Well thank you Ma'am
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform