Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vartype function fixed in SP3...
Message
From
06/07/1999 20:55:44
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00237900
Message ID:
00238045
Views:
16
>To summarize:
>
>There are only 2 conditions in which I am able to get vartype to generate an error:
>1. _vfp.foo  [or _vfp.anything not defined to _vfp]
>
>2. oForm = newobject("form")  && or pick any object to create
>   vartype(oForm.BadProp) returns U
>   oForm = .null.
>   vartype(oForm) returns X
>   vartype(oForm.anything) generates an error
>
>Personally, I see no problem with the generation of the error for the second condition. I am ambivalent about the first condition because I seldom use _vfp. If I do, I always make dang sure the property exists before I add it to my code.

Well, VARTYPE doesn't throw an error when checking defined properties of COM objects, but it does throw an error for undefined properties of COM objects. (For any body that doesn't see the relevance, _VFP is actually VFP's COM interface, and not a native fox object).

I suspect that you uncovered still one more situation that VARTYPE wasn't built to handle. I am actually a little surprised that VARTYPE works with COM properties at all.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform