Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Testing a objects existence
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00366567
Message ID:
00366671
Vues:
17
Eric,

It is really very simple.
oObj = CreateObject("Whatever")
* oObj has been created as a variable and has a type of O for object

?oObj.Name
* Displays the value of teh Name property of object oObj

?TYPE("oObj.Name")
* Returns C because the Name property of the object does is character type

oObj = .NULL.
* The object oObj is destroyed but the variable still exists and is type O 
* and value NULL

?oObj.Name
* Error since oObj does not exist as an object, it does as a variable

? TYPE('oObj")
* Returns O because the datastype of oObj is Object, even though its value
* is NULL

?TYPE("oObj.Name")
* Returns U because the Name property of the object does not exist
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform