Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TYPE variable error
Message
 
À
24/01/2009 09:53:31
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01376717
Message ID:
01376893
Vues:
13
>Getting "Function argument value, type, or count is invalid" error on this line if lcExistingValue is .F. when getting here. I still can't figure out what is the best way to check for the existence of a variable and whether it has a value.
>
>		IF TYPE(lcExistingValue) = 'C' AND !EMPTY(lcExistingValue)
>
Jay,

Just to add a little to what Dan said. The TYPE() function takes an expression as its argument and evaluates that expression for the data type while the VarType() function takes a variable as its argument. So TYPE("lcVariable") and VarType(lcVariable) will give the data type of the same thing. I prefer the VarType() function when I know the variable does exist and the TYPE() function when I am not sure iof it exists or not especially when delaing with objects and their properties because VarType(oObject.Property) will erro out if oObject doe snot exist while TYPE("oObject.Property") will simply return U as undefined.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform