Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check if a property is on a object
Message
 
 
À
31/07/2008 14:22:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
01335595
Message ID:
01335603
Vues:
19
I may answered wrong question. If you want to check if property exists, use PEMSTATUS()
* Does property exist?
? PEMSTATUS(myobject, "myproperty",5)
The code I posted originally, checks if existing property holds an object reference
There's a typo in it. The property reference should not be enclosed in the quotes. Sorry about that.
* Is property an object?
IF VARTYPE(myobject.myproperty) = "O"

* For example
myobject = CREATEOBJECT("Empty")
ADDPROPERTY(myobject, "myproperty")
? VARTYPE(myobject.myproperty)
myobject.myproperty = NULL
? VARTYPE(myobject.myproperty)
myobject.myproperty = CREATEOBJECT("Empty")
? VARTYPE(myobject.myproperty)
>Thanks, that works great. Don't know why my brain is having a hard time with vartype these days. :)
>>
>>IF VARTYPE("myobject.myproperty") = "O"
>>
>>
>>>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform