Re: how do people feel about exit function from loop
- From: "Steve Gerrard" <mynamehere@xxxxxxxxxxx>
- Date: Tue, 24 Jul 2007 18:28:12 -0700
"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).
I am not opposed to exit for, in fact I quite like Larry's solution to the OP's
task. But I often find that after the loop, I need to know why it ended - found
the thingy, or ran out of places to look. I am now jaded enough to believe that
even if I don't need it today, and can't see how I ever would, eventually I will
need to know it for some reason, so might as well set it up that way. Sigh.
.
- Follow-Ups:
- Re: how do people feel about exit function from loop
- From: Michael C
- Re: how do people feel about exit function from loop
- References:
- how do people feel about exit function from loop
- From: greg
- Re: how do people feel about exit function from loop
- From: Ken Halter
- Re: how do people feel about exit function from loop
- From: Jan Hyde (VB MVP)
- Re: how do people feel about exit function from loop
- From: Steve Gerrard
- Re: how do people feel about exit function from loop
- From: Michael C
- how do people feel about exit function from loop
- Prev by Date: Re: Compacting a Random created file
- Next by Date: Re: how do people feel about exit function from loop
- Previous by thread: Re: how do people feel about exit function from loop
- Next by thread: Re: how do people feel about exit function from loop
- Index(es):
Relevant Pages
|