Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to know if an object exist in a form
Message
From
30/01/2001 16:46:47
 
 
To
30/01/2001 16:41:38
David Brunelle
Université de Sherbrooke
Sherbrooke, Quebec, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00470302
Message ID:
00470355
Views:
48
>I am not looking whether a certain property exist or not, I am looking if an object of a certain type (like a text box for example) is present in the form. I looked at PEMSTATUS(), but I'm not sure that really is the function I need...

If what you're looking for is a particular object, you could use PEMSTATUS() to see if the property containing the object exists, or you could use TYPE() to see if it's of type "O".
IF PEMSTATUS(_SCREEN.ActiveForm,"cntxxxxxx"),5)
  *
  * Object exists
  *
ENDIF
or
IF TYPE("_SCREEN.ActiveForm.cntxxxxx")="O"
  *
  * Object exists
  *
ENDIF
You could also spin through the form's Controls collection to see if what you're looking for exist. You may have to deal with containership heiarchy if the form is not the parent.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform