Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Testing for presence of an object
Message
De
29/01/2002 18:37:06
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00612283
Message ID:
00612538
Vues:
21
Hi Sergey

>
IF TYPE("Thisform.myobject.Name") = "C"
At the risk of being pedantic, the above is true except in two cases:

[1] The object was created using SCATTER NAME from a table which does not include a field called "Name". The EMPTY base class (used with SCATTER NAME) does not have any exposed properties at all - not even a name.

[2] The name property has been flagged as 'Hidden' (and is called from anywhere but the root class) or 'Protected' (and is called from anywhere but root or sub class).

In either case the above line of code will fail. The only really safe test is still:
IF TYPE( "Thisform.myobject" ) = "O" AND NOT ISNULL( Thisform.myobject )
----
Regards
Andy Kramek
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform