Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to know if an object exist in a form
Message
De
30/01/2001 16:46:47
 
 
À
30/01/2001 16:41:38
David Brunelle
Université de Sherbrooke
Sherbrooke, Québec, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00470302
Message ID:
00470355
Vues:
44
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform