Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The creature that won't die
Message
De
25/03/2010 12:01:49
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
VFP Compiler for .NET
Divers
Thread ID:
01456123
Message ID:
01457190
Vues:
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.

Well thank you Ma'am
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform