Re: how do people feel about exit function from loop



But the same logic applies...if you're concerned about having one way out of
a function, it follows that you will likely be the type who also likes one
way out of a loop (for most of the same reasons), thus wanting to avoid
Exit.


Rob

"Michael C" <nospam@xxxxxxxxxx> wrote in message
news:eTstCwkzHHA.4916@xxxxxxxxxxxxxxxxxxxxxxx
"Steve Gerrard" <mynamehere@xxxxxxxxxxx> wrote in message
news:js2dnQMV9MvgizvbnZ2dnUVZ_sOrnZ2d@xxxxxxxxxxxxxx
Indeed, I find more and more that I like to declare a boolean expressly
for the purpose of controlling a loop, such as Found or Done. It makes
the code completely clear, it is easy to adjust the conditions where the
flag gets set, and it is useful following the loop for deciding what to
do next.
While Not Done
always makes perfect sense to me as a loop control.

Isn't an exit for that much simpler tho? You still get to have one way out
of a function if that is important to you (in 99% of functions it is not).

Michael



.



Relevant Pages

  • Re: Infinite Loops and Explicit Exits
    ... > CS> One of these proposals relaxes the current restriction that an EXIT ... > termination of the loop is not visible at that point. ... > terminating condition is visible in that context. ... > You now want to allow this remote procedure, ...
    (comp.lang.cobol)
  • Re: Houston-related rants was Re: forced merges/inside lane merges/AASHTO "tapered merges"
    ... >> Are you sure about the North Loop and I-45? ... >> in particular the westbound exit for Fondren/Gessner. ... How could HCTRA put an exit ramp for eastbound ... and the West Houston Center Blvd exit still shows Old Westheimer ...
    (misc.transport.road)
  • Re: Exit Do
    ... I've been instructed by a dot net / asp programmer that Exit Do is ... I am using nested loops and need to exit out of one loop into ... If Some Reason to stop loop then Exit Do ... Code Stage B ...
    (microsoft.public.scripting.vbscript)
  • Re: Exit Do
    ... I've been instructed by a dot net / asp programmer that Exit Do is ... I am using nested loops and need to exit out of one loop into ... Code Stage B ... likely to lead to bugs and readability problems. ...
    (microsoft.public.scripting.vbscript)
  • Re: Infinite Loops and Explicit Exits
    ... CS> There are cases in which EXIT PERFORM is, I think, clearer than GO TO ... procedure-name-1 SECTION. ... repetition in the main loop statement is being overrun by some minor ... particularly when the requirements of elegance ...
    (comp.lang.cobol)