Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Testing for presence of an array?
Message
De
04/05/2005 19:21:10
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
04/05/2005 19:18:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01011099
Message ID:
01011101
Vues:
16
>Hi. How do you test for the presence of an array?
>
>Thanks, Randy

I think it is something like this:
if type("MyVar") # "U"
  * The variable or array exists
endif

if type("MyVar(1)") # "U"
  * The variable exists, and is an array
endif
You might also test with vartype() (without the quotation marks), which is supposed to be faster.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform