exiting out of nested loops

new topic     » topic index » view thread      » older message » newer message

> Kat,
> still wants "goto" in Eu, then she can "exit" out of any loop with the one
> command, to a properly well defined and easily read local target.

yes, this is real problem, because you have to add flags and check them
every time. (Goto's really aren't that bad as I said once.)

one good solution, i think, would be this way:

while 1 do
    while 1 do
        exit --exit first loop
        exit --exit parent loop
    end while
end while


--now you have to do it this way:

while 1 do
    while 1 do
        doExit=true--set flag
        exit
    end while

    --we have to check this flag *every time*, it eats up time
    if doExit=true then
        exit
    end if
end while

Good idea, huh? smile i really like it, simple and fast.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu