Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exit nested FOR loops
Message
De
27/07/2007 14:02:59
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01244106
Message ID:
01244202
Vues:
23
>>>>An EXIT will exit the inner loop. You need another EXIT to exit the outer loop. What I usually do to exit multiple loops is to set a variable, in the inner loop, that can be tested in the outer loop.
>>>>
>>>Just set both counters to maximum number and you will fall off the loops.
>>
>>Oh, I see. That's an interesting alternative.
>
>The only problem is that the current loop cycle is going to be executed anyway as opposed to exit.

Well, I would think you could increment the loop variables to maximum and then do an EXIT immediately. This would avoid defining additional variables, just to control whether a certain process should continue.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform