Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
how to determine if a var is = nothing
Message
De
07/09/2000 09:51:02
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00413285
Message ID:
00413448
Vues:
22
>>Try VARTYPE(myvar) -- if it returns "O" it's an object, if it returns "X", it's NULL
>
>Sorry Guys,
>
>I meant to post this in the VB forum. Doh!
>
>BTW, type("MyObject.Name") = "C" is the best way in VFP. Vartype returns the type of the var, regardless of it's content. So if it was an object and was later set to .null. it still returns "O".
>

TYPE() behaves like this, VARTYPE() doesn't.


lox = CREATEOBJ("form")
? TYPE("lox") && "O"
lox = .NULL.
? TYPE("lox") && "O"

lox = CREATEOBJ("form")
? VARTYPE(lox) && "O"
lox = .NULL.
? VARTYPE(lox) && "X" - null
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform