Re: I miss loop

Tech-Archive recommends: Speed Up your PC by fixing your registry



Yes, that'll also work.

Sebastian wrote:
I think you may have misunderstood the suggestion for using goto. Make the goto go to the end of the loop, not the beginning, and you get exactly the functionality of a continue statement, no messy inner loop.

Ex:
do
.
if something goto LoopContinue
.
.
.
if something goto LoopContinue
.
if something goto LoopContinue
.

LoopContinue:
while continue


cj wrote:
I thought about that this AM but after all the thought I have a double do loop.

do
do
.
if something exit do
.
.
.
if something exit do
.
if something exit do
.
while innerLoop
while continue

Not beautiful but it was time to make a decision and move on. Couldn't bring myself to use goto.



Scott M. wrote:
How about making the loop in its own procedure that can take the appropriate arguments you'll need to use to determine if the loop "is going well and should continue"?

You can still exit from the loop (or from the sub if the loop is in one) if you need to and you'd be able to re-call the loop/procedure and pass it what it needs to begin again.

"cj" <cj@xxxxxxxxxxxxx> wrote in message news:ex3Rt36RGHA.1572@xxxxxxxxxxxxxxxxxxxxxxx
When I'm inside a do while loop sometimes it's necessary to jump out of the loop using exit do. I'm also used to being able to jump back and begin the loop again. Not sure which language my memories are of but I think I just said loop somewhere inside the loop and it immediately jumped back to the start of the loop and began again. I can't seem to do that in .net. I this functionality available?


.



Relevant Pages

  • Re: how do people feel about exit function from loop
    ... stand out to me far better than a For Next loop for that, ... line, the line that starts the loop, I know ALL the exit conditions for the ... And now we get back to why Goto is "silly" when Exit is not. ... as I have knowledge of only a few languages. ...
    (microsoft.public.vb.general.discussion)
  • Re: Using Wildcards in a Select Case Statement ?
    ... you could, as above, use Exit Do. ... I have never *and I mean NEVER* needed a GoTo ... I have found a fair number of cases where a GoTo simplifies the code ...
    (microsoft.public.vb.general.discussion)
  • Re: Iteration in lisp
    ... state machine is just a tagbody and goto. ... But if you need to change the state-transition-matrix in the middle ... loop and either table-driven or separate-functions for defining the ... (tagbody state1 (trace-state1 aux) ...
    (comp.lang.lisp)
  • Re: COBOL aint quite dead - yet !
    ... of control there is nothing wrong with goto. ... The loop is entirely abstracted away. ... Then we have well-formed loops with a single invariant and a looping ...
    (comp.lang.cobol)
  • Re: I miss loop
    ... I refered to exit sub where I meant exit do. ... I'm not sure but I suspect the functionality of the not in VB.net 2003 loop/continue statement would work more like the nested loops alternative than the goto alternative. ... In a nested loop situation the exit sub would exit the inner loop and therefore you'd re-enter the loop with any variables declared inside the loop being refreshed, for lack of a better word. ...
    (microsoft.public.dotnet.languages.vb)