Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vartype with tables
Message
From
26/12/2007 12:06:29
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01277433
Message ID:
01277562
Views:
20
>>>I can use type for if there is a field in table:
>>>
>>>
?type("mytable.myfield")="U"
>>>
>>>but with vartype
>>>
>>>
?vartype("mytable.myfield")="U"
>>>
>>>is generates variable not found. Isn't that a bug?
>>
>>Here's what we said in HackFox about this:
>>
>>"Because VARTYPE() explicitly passes the expression to test as a parameter, it fails if an expression cannot be evaluated, causing an error 12, "Variable not found"—you'll still want to use TYPE() to check if a variable exists."
>>
>
>Which leaves the usefulness of VARTYPE() open to question.

Oh, but I like vartype(), which returns X if the variable is null
aa='aa'
aa=null
?type('aa'), vartype(aa) && C X

obj=createobject('textbox')
obj = null
?type('obj'), vartype(obj)  && O X
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform