Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Argument starter - The roots of all evil
Message
De
07/09/2004 13:58:14
 
 
À
07/09/2004 09:36:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00938079
Message ID:
00940046
Vues:
45
>>>First I'd store ALEN() in a var, to save reevaluating it every time thro' the loop :),
>>
>>No need. FOR loops evaluate their bounds only once.
>>
>>Tamar
>
>Ah, good. Didn't know that. Still, it's good practice so to do generally, no?
>You would do that for the do while loop tho'?

Yep, because DO loops evaluate their bounds each time through. I assume that one of the reasons FOR loops are faster than DO loops (last time I tested, which was VFP 7, an empty FOR loop was about 10 times faster than an empty DO WHILE) is that the FOR loop evaluates the end boundary only once and stores that value.

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform