Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining if Variable/Object Exists
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00118329
Message ID:
00119562
Views:
18
>>Is there a way to determine if a variable or an object exists in memory?
>>
>>I want to test to see if a form exists before I try to open it again.
>>
>>Any help is appreciated!
>>
>>Jeff
>
>Use the TYPE() function. If it doesn't exist it will return a 'U' (unknown). Example: IF TYPE("formname")=='O' (object) - the formname must be contained in quotes or it will expect it to be a variable containing the form name to be evaluated. Hope this helps,

And just think: In VFP6 we get VALTYPE() so we don't have to remember those quotes inside the Type() parameters.
If VALTYPE(_screen.TheFormName.name) = "U"
....

Barbara
Barbara Paltiel, Paltiel Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform