Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Evaluate
Message
De
29/06/2003 06:41:13
 
 
À
29/06/2003 05:27:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00805082
Message ID:
00805084
Vues:
38
Hi Chaim

>Some one can give me information about this function and when do I have to use with this?

EVAL() is used to evaluate an expression and return the result. This is often used to resolve a reference to an object when one of several could be used. Code like this:
DO CASE
  CASE lcName = 'FirstObj'
    loRef = This.FirstObj
  CASE lcName = 'NextObj'
    loRef = This.NextObj
  CASE lcName = 'OtherObj'
    loRef = This.OtherObj
ENDCASE
can be replaced by simply:
loRef = EVAL( "This." + lcName )
which avoids the necessity of hard-coding all the alternatives and is much more efficient too.
----
Regards
Andy Kramek
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform