Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
how to determine if a var is = nothing
Message
From
07/09/2000 09:51:02
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00413285
Message ID:
00413448
Views:
23
>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform