Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Testing for the presence of an object
Message
 
To
24/05/2001 21:02:33
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00511250
Message ID:
00511297
Views:
16
>>How do you test for the presence of an active object?
>>
>>thanks, Randy
>
>one way us vartype() function.
>
>vartype(oApp) returns 'O' if oApp exists as an object, 'U' or 'X' if it doesn't. Look up in help to see possible return values...

Not exactly. VARTYPE(oApp) or TYPE("oApp") will still return "O" if oApp was NULLified and does not exist anymore. It is better to add the check AND !ISNULL(oApp), or check for TYPE("oApp.Name") = "C" (excluding the objects which created with SCATTER NAME command - they don't have native .Name property.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform