Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Has an object been instantiated?
Message
From
16/04/1998 14:48:05
 
 
To
16/04/1998 14:41:23
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00092641
Message ID:
00092644
Views:
24
>Does anyone know of a way to tell if an object has been instantiated? In particular I am working with a form that may or may have other forms running behind it. How can I tell if those other forms are instantiated or not?? Is there a function similar to WEXIST() for objects? I thought about displaying memory to an array and ascaning it for the form name but it seems cumbersome and I was hoping an easier way might exist!
>
>AHWBA!
>
>Kevin

Generally speaking, WEXIST() will work. However, OO-way (which will prove to be advantageous in many situations) is to check form object.
IF TYPE("frm1")="O" AND NOT ISNULL(frm1)
 =messagebox("form exists")
ELSE
 =messagebox("form doesn't exist")
ENDIF
Note: if you don't use formsets that you better create some oApp collection to hold form references and then you could check for this collection members:
if type("oApp.myforms[3]")="O" ....
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform