Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Who'd have thought....
Message
De
02/11/1999 09:10:36
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00285125
Message ID:
00285426
Vues:
16
>>Hi Wayne,
>>
>>>This FOR loop would fire???
>>>FOR i = 0 TO 0
>>> WAIT WIND ALLT(STR(i))
>>>ENDFOR
>>
>>Well think of it like this, how many times does "for x = 1 to 2" fire? Twice, right? Well, if you subtract the second term by one, you still be firing it one less. Don't let the Zeros confuse you, its simply a value of the counter.
>
>Mike,
>
>Partially correct, the FOR loop will execute at least once under all conditions. You cannot create a FOR loop that won't run once.


Jim,
I can. As long as the initial value is less then ending and stepping is positive it wouldn't run.
use sometable
local ix, counter
counter = 0
scan
 *some code
 counter = counter + 1
endscan
for ix = counter to 10
 ? ix
endfor
ix would never be printed if scanned reccount is more than 10.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform