Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Coding Standards
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00115272
Message ID:
00116066
Vues:
19
>Yes, there is. But it works in VFP (it doesn't work in Pascal, for example).
>
>If I have to chose between an EXIT and changing the index value, I change the index value. The difference is that the code between the index change and ENDFOR gets executed every time (this doesn't happen with EXIT). This is important especially in FoxPro where so many things "happen" because of SET commands and because of current program status (alias, index, etc).
>
>I've seen countless bugs because some code was skiped because of a LOOP or EXIT. And these bugs are (usually) not in the first version, but they are introduced later, when the code is modified without considering the situation when the loop is forced.

I'm not sure I agree with you on use of EXIT...I think the EXIT is a clearer indication of a loop egress than altering an index, so makes for better code readability. I do agree, though, that if you're going to use it, it should go at the end of the code just prior to ENDFOR...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform