Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Variable Exists?
Message
De
02/10/2001 18:09:07
 
 
À
02/10/2001 18:00:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00563335
Message ID:
00563339
Vues:
13
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform