Re: how do people feel about exit function from loop




"Jan Hyde (VB MVP)" <StellaDrinker@xxxxxxxxxxxxxxxxxxx> wrote in message
news:fbdba3pcbrgsrkdllt2tm4idhg7r658bo7@xxxxxxxxxx
"Ken Halter" <Ken_Halter@xxxxxxxxxxxxxxxxxxxxxxxxx>'s wild

As everyone says... it's upto the coder. Personally, I'd rather there be a
single way in and a single way out of a procedure. It just makes maintenance
that much easier, imo.

Me too, even in means checking a flag just for that purpose.
--

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.



.



Relevant Pages

  • Re: how do people feel about exit function from loop
    ... even in means checking a flag just for that purpose. ... for the purpose of controlling a loop, ... always makes perfect sense to me as a loop control. ...
    (microsoft.public.vb.general.discussion)
  • Re: EXIT PERFORM Help, please
    ... > about EXIT PERFORM Help, ... > I would do it the other way round: set the flag, ... > after that loop the condition FINISHED is true, ... but it serves the purpose. ...
    (comp.lang.cobol)
  • Re: Any raw data specs for the Apple IIgs BRAM?
    ... original set of example data with the original assembly code and with ... the AppleScript, and they don't match. ... ' current value of the carry flag and then change the carry flag ... ' end of the loop ...
    (comp.sys.apple2.programmer)
  • Re: semi-timely interrupt
    ... check the flag on every RTS, LOOP, BREAK instruction. ... want to insinuate an interrupt flag check into RTS, LOOP, and BREAK ...
    (comp.programming.threads)
  • Re: Signal-Unsafe Problem
    ... About the sig_atomic_t flag issue, the problems for my program are that ... My program is also busy running other code. ... There's no need to run a busy loop for the flag alone. ... You can either process incoming data right away, ...
    (comp.os.linux.development.apps)