Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vartype() bug in VFP 7.0?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00825419
Message ID:
00825423
Vues:
22
See Re: VARTYPE vs TYPE with Parent property Thread #682266 Message #683269

>I have run into this problem with vartype() and properties which may contain object references or NULLs.
>
>HackFox mentions that you shouldn't use vartype() to check for the existence of a variable, because it will crash with "variable not found." This is NOT my situation. I have checked that the property exists, now I'm trying to determine its type!
>
>I have a class which usually appears on a page of a pageframe class with certain other pages. I want to check if I have that situation, then query certain properties on another page of the parent pageframe. (I know I just broke 3 or 4 OOP design rules.)
>
>I test that pemstatus(this.parent, "parent", 5) = .T., so I know the property exists. Then I test vartype(this.parent.parent) to see whether it's an object (or NULL, presumably).
>
>Instead of returning either "U" for undefined or "X" for null as I would expect, I CRASH with "Parent is not an object."
>
>According to VFP docs <g>, and my past experience through VFP 6, vartype should return "U" if a variable/property is undefined, "X" if it's null, or the type (e.g. "O" if it's an object reference.)
>
>Whazzup?
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform