Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Loops
Message
De
04/04/2007 11:39:11
 
 
À
04/04/2007 10:04:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Loops
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01211796
Message ID:
01212040
Vues:
11
>>>I believe that Basic (and perhaps others) have a WHILE - WEND where the code is always evaluated at least once and the loop control is at the bottom.
>>
>>Pascal has a REPEAT-UNTIL construct that works that way:
>>
>>REPEAT
>> * do something
>>UNTIL condition
>>
>>Tamar
>
>I like the UNTIL idea. Is there a way to do that in VFP9? Should the Sedna people consider it?

I really don't see any need for it. You can vary the WHILE condition to get the same results.
I = 1
REPEAT
   ? I
   I = I + 1
UNTIL I > 5


I = 1
DO WHILE I <= 5
   ? I
   I = I + 1
ENDDO
REPEAT UNTIL bloats the language with an unnecessary construct unless the execution time for evaluating the condition one extra iteration becomes important.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform