Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vartype: behavior
Message
 
À
22/09/1998 09:58:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00136852
Message ID:
00139505
Vues:
43
Hi Jim,

>I hope that the powers that be reconsider this stand.

That's the problem. They did.

The reason why VARTYPE() is faster as TYPE() is that TYPE() requires an evaluation of the expression at runtime. VARTYPE(), OTOH, can be evaluated (to be precise: tokenized) during compiling. You can say that:

TYPE("Variable") == VARTYPE( EVALUATE("Variable") )

But later, when some people complained about it, an exception handler (or sort of, I'm not the programmer) was added to capture not existing variables and return "U" in that case. Since usually VFP evaluates parameters before it passes them to the function, with the exception of array functions, this must have required some extra code on a higher level then the actual function. Thus, we have side effects like VARTYPE() not working this way with:

a) references that are created by VFP when there's an appropriate object, like ActiveForm, ActiveControl, Parent, etc.

b) with OLE controls. VARTYPE(_VFP.Blah) causes an OLE exception error

c) with properties that are adressed via a not existing reference, like VARTYPE(Thisform.oObject.Property) when oObject is NULL.

Doesn't the English language have a word for that: Cool! < eg >


Christof
--
Christof
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform