Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check for not defined variable
Message
 
 
To
12/04/2007 21:48:23
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01215370
Message ID:
01215371
Views:
15
>Hi,
>If a variable not defined in runtime, it will cause an error during
>runtime.
>How to check a variable not defined in runtime ?
>
>Thanks.

if vartype(m.myVariable) = 'U' && this variable is not defined

For object properties you may use PEMSTATUS function and if you want to check if a variable is an array, you may try
if type('myArray[1]') = 'U' && myArray is not an array
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform