exiting out of nested loops
- Posted by =?iso-8859-2?B?VG9uZSCpa29kYQ==?= <tone.skoda at SIOL.NET> Jan 19, 2001
- 516 views
> 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? i really like it, simple and fast.