Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

exiting multiple nested loops

Status
Not open for further replies.

funkydonkey2000

Programmer
May 29, 2003
12
0
0
AU
Just wondering if there are any ways of exiting multiple nested loops. for example:

do while i<10
do while j<10
exit do
loop
loop

the exit loop in the above only exit the inner loop, is there a way to exit both loops.
 
Set an exit flag in the inner loop and check for this in the outer loop, or you could set the exit condition of the outer loop before exiting the inner loop.





Chris.

Indifference will be the downfall of mankind, but who cares?
 
cool. What if I have like 10 layers of nested loops, that will be trouble
 
Only from a debugging\maintenance point of view



Chris.

Indifference will be the downfall of mankind, but who cares?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top