Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Network:
Windows 2000 Server
>>>>>Does a scan endscan loop exit at the bottom of the loop or at the top?
>>>>
>>>>It goes from top to bottom.
>>>
>>>Yes, that's right. But, a do while loop loops and at the end it exits the loop at the top. I believe that a for next loop runs and exits at the bottom.
>>
>>I don't see why it's important. One should not write code based on these assumptions. Either you exit loop specifically (by Exit) or you don't care.
>
>I was under the impression that if you have an EXIT in there, then the alogorythm isn't really designed "properly".
I think that's bunk.
To have 'properly designed' (without an EXIT) you simply program the loop to go through all items, probably coding a LOOP to bypass the items you are no longer interested in.
Which is easier to understand... code that EXITs as soon as it can or code that intentionally loops through the whole entity regardless but ignores lots of items?
Which is faster... a loop with an EXIT in it or a loop that inspects all items regardless?
cheers
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement