Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is this command that replace Type()?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00385673
Message ID:
00385699
Views:
14
>Can I use it to check if a Object exist?
>Will this blow if the object do not exist?
>
>if vartype(thisform.oIntraData)="O"
>   ...
No. VARTYPE should only be used to check the type of a variable or property that you KNOW exists. It's shines in use for checking parameter types for functions with flexible parameter schemes. It should NOT be used to test for the existence of an object, a property, or really for that matter a variable. The VFP team has expressed repeatedly that VARTYPE is not a replacement for TYPE(), and should not be used indiscriminantly. They changed its behavior after its initial release to make it more friendly to unknown variables, but I don't think that they should have- it makes its use even more confusing.
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform