Re: I miss loop




"cj" <cj@xxxxxxxxxxxxx> wrote in message news:%23PqmYTHSGHA.4600@xxxxxxxxxxxxxxxxxxxxxxx
Thanks for all the support. I posted this to Mythran also but I wanted to make sure you saw it as well.

In reviewing some of this just now I see one thing that would need to be considered in choosing goto vs nested loops. 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. I haven't tried but I get the impression from the help that goto can't be used to jump outside a loop (to the line above it) so it could be restarted, hence goto could only be used to go to the first line inside the loop. variables inside the loop would not be refreshed they would be as they existed before the goto was executed. This could be good or it could be bad. Just has to be checked into and considered.



Depends how you write it...

Your explanation is correct if written this way:

[begin loop]
[:MyLabel]
[do stuff]
[goto MyLabel]
[end loop]

You explanation is in-correct if written this way:

[begin loop]
[goto MyLabel]
[do stuff]
[:MyLabel]
[end loop]

So placing the label right before the loop re-starts will make it iterate/increment properly :)

Mythran

.



Relevant Pages

  • 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: acceptable use of goto?
    ... loop, forward within the loop at various points, then forward out of ... Then you give every statement a label. ... No goto statements. ... Then I build a framework (of if or switch statements) to eliminate the ...
    (comp.lang.c)
  • Re: GSoft BASIC Ramble
    ... Leave and exit statement are not simply "goto statement without a line ... They are structure and proper ways of leaving a loop when a ... small system programming community--and the result was not pretty! ...
    (comp.sys.apple2)
  • Re: Nested Scope
    ... a local scope that includes all code inside the loop. ... goto statements are ... typically used to break out of nested loops, and in the example above, the ... you cannot use a goto statement to ENTER ...
    (microsoft.public.dotnet.languages.csharp)