Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Commonly misused and abused VFP features
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00310951
Message ID:
00311963
Vues:
27
>>In general, the cost of EVAL() is high in loop/repetition conditions; the macro-expansion is performed once for the statement as a whole, and not executed against each iteration.
>
>Nope. It's executed per iteration. But you have to know when VFP evaluates a line. A loop command like FOR is only evaluated once. Changing the TO variable doesn't affect the number of loops. A SCAN FOR condition is also only evaluated once, if it's optimizable, otherwise it's evaluated for each record.
>

I think that we're saying the same thing - the command line is macro-expanded, then executed. If the condition were based on an EVAL(), the EVAL() would take place per iteration, when the condition was tested; since the condition has already been macro-expanded before the line is executed and the condition to evaluate is defined, the cost of macro expansion is incurred once.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform