Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Test If a Variable exists
Message
From
01/09/2006 01:54:54
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01150290
Message ID:
01150301
Views:
21
This message has been marked as the solution to the initial question of the thread.
>
>IF VARTYPE("SomeVariable") <> "U"
>  * Variable exists
>
>IF VARTYPE("SomeObject") = "O" AND NOT ISNULL(SomeObject)
>  * Object exists
>...
>
>

This is the TYPE() syntax

The correct syntax is
IF VARTYPE(m.SomeVariable) <> "U"
  * Variable exists

IF VARTYPE(m.SomeObject) == "O"  && this part is useless AND NOT ISNULL(SomeObject)
  * SomeObject is an Object reference
...
>>I have in mind that VFP has a function to test if a variable or object exist. I'm trying to locate it in the help file but I can't.
>>Any help will be appreciated.
>>Thanks in advance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform