Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Argument starter - The roots of all evil
Message
De
08/09/2004 05:08:07
 
 
À
07/09/2004 13:58:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00938079
Message ID:
00940208
Vues:
44
>>>>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

So how do they compare when such as ALEN() has been evaluated first before the do loop? I'd never considered this but, for a large list/array look-up (not ever had to do too many of them tho'), it might appear, otherwise, (gulp) that a, dare I say it, EXIT in a for loop might just be acceptable. THERE I'VE SAID IT!!!! :-)

Terry
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform