Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine if an object exists
Message
 
 
À
09/05/1998 13:35:58
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00098172
Message ID:
00098308
Vues:
38
Cetin

SCATTER NAME uses an undocumented internal object type that had no visible properties other than the field names. We used to be able to derive subclasses from it in VFP3 but not in VFP5.

Hidden and Protected cause .Name to return U in TYPE(). Admittedly this is a rather special case, but if it weren't for special cases us programmers would be out of jobs. *g*

This is the output of the code below:

C
C
U
U
U
U
activate window "debug output"

o1 = createobject( "test" )
debugout type( "o1.name" )
o1 = createobject( "testa" )
debugout type( "o1.name" )
o1 = createobject( "test1" )
debugout type( "o1.name" )
o1 = createobject( "test1a" )
debugout type( "o1.name" )
o1 = createobject( "test2" )
debugout type( "o1.name" )
o1 = createobject( "test2a" )
debugout type( "o1.name" )

define class test as custom
enddefine

define class testa as test
enddefine

define class test1 as custom
   hidden name
enddefine

define class test2 as test1
enddefine

define class test1a as custom
   protected name
enddefine

define class test2a as test1a
enddefine
>After some chat with you, now I also agree that TYPE([oControl.Name]) = "C" is enough. As I learned :
>- Scatter name oName wouldn't be treaded like a real object.
>- And with that exception Name property cannot be prevented to be seen.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform