Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro substitution
Message
De
17/12/1999 16:45:03
 
 
À
17/12/1999 16:39:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00305094
Message ID:
00305494
Vues:
21
>>I don't disagree - but the line of code I posted is legal, and accomplishes the task without the need for the intervening memvar. I rarely advocate macro expansions, but Mike's syntactic argument was not correct. I did state up front that, IMO, EVAL() is a better solution.
>
>Can you think of a place where macro expansion would be better than EVAL ?

Sure - expanding the target of an operation or a full clause of a command where name substitution is inappropriate are obvious ones. Situations where the macro expansion occurs once rather than per record EVAL() is another, for example:

cExprToTest = 'Color = "RED"'

SELECT * FROM MyTable WHERE &cExprToTest

will outperform

SELECT * FROM MyTable WHERE EVAL(cExprToTest)

since the macro expansion is executed once, and the expanded statement then becomes Rushmore optimzable (assuming appropriate tags), where the EVAL() must execute against each record of the table.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform