Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Test If a Variable exists
Message
From
01/09/2006 09:33:38
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01150290
Message ID:
01150353
Views:
30
It depends too on exactly what he's testing for. If he really does just want to test for existence, then "AND NOT ISNULL(SomeObject)" might be an issue. An object can be null and still be an object. No?

>Yes,
>It was a typo in my post. It should be TYPE() function. Sorry about that.
>
>IF TYPE("SomeVariable") <> "U"
>  * Variable exists
>
>IF TYPE("SomeObject") = "O" AND NOT ISNULL(SomeObject)
>  * Object exists
>
>>
>>>>My syntax is correct.
>>>>
>>>Sorry, it isn't
>>>The variable name does not need quotes for vartype()
>>>VARTYPE("SomeVariable") will always return 'C'
>>
>>Gregory and Fabio are right, Sergey!
>>It's documented as they say. And I tested it.
>>The quotes are used if using TYPE().
>>And documentation says that VARTYPE() is faster than TYPE().
>>
>>Many thanks to both of you.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform