Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variable Exists?
Message
From
02/10/2001 18:09:07
 
 
To
02/10/2001 18:00:24
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00563335
Message ID:
00563339
Views:
12
>Is it possible to find out if a variable exists or
>it isn't store to memory at all?
>For example, if I put only one line in a program:
>
>wait window MyVar
>
>program reports an error that variable MyVar wasn't found,
>so if I could make something like this
>
>if VarExist("MyVar")
> wait window MyVar
>endif
>
>would be helpful for me.
>
>Thanks, Zlatko.
IF TYPE ("MyVar") <> "U"
     WAIT WINDOW TRANSFORM (MyVar)
ENDIF
TYPE won't break whatever you feed it. Remember to include the quotes around the variable name as TYPE essentially does an EVALUATE first.

If you're using VFP 6.0+, the TRANSFORM function, with only one parameter, will convert the variable to a string which is compatible with the WAIT WINDOW format.

Enjoy!

Jay
Previous
Reply
Map
View

Click here to load this message in the networking platform