Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VARTYPE erroring out
Message
 
 
To
12/05/2004 10:42:54
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00903174
Message ID:
00903176
Views:
15
To avoid such problem, always use TYPE() function to check if variable/property/field exists. To check type of existing variable you can use TYPE() or VARTYPE() function.

>Can anyone tell me how the following line of code could possible throw an error:
>
>IF VARTYPE(mdepartment) <> "U"
>
>We get a "Variable mdepartment not found" error.
>
>Well, duh, that is what we are checking. Why is this throwing a runtime error? I have seen VARTYPE() have trouble when objects are involved...like looking for a specific property, but this is just a straight memory variable. How can this be erroring out? We are goung to try using TYPE("mdepartment") instead, but I am still curious as to why VARTYPE() is having problems here...
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform