Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invalid subscript reference
Message
De
30/11/2006 11:24:46
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01173721
Message ID:
01173741
Vues:
10
Hi Sergey

Hmmm, that's interesting. I've never bothered to test that. Is it not true that, at least in other languages, you could use code like that to (lazily) short-circuit the loop to get out of it?

Anyway, as a general rule, I always do the func once and store to a var.


>Terry,
>
>All expressions in the FOR loop statement are evaluated only once at the start of the loop
>
>lnMin = 2
>lnMax = 3
>FOR i = lnMin TO lnMax
>	? i, lnMin, lnMax
>	lnMin = 0
>	lnMax = 5
>ENDFOR
>
>
>>
>>Just on a wee efficiency note: why are you evaluating ALEN(laFiles,1) every time through the for loop - up to 13,000 time?
>>
>>I always use something like:
>>
>>lnAlen = ALEN(laFiles,1)
>>For I = 1 to lnAlen ...
>>
- 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