
-----------------------------------
ScaryRat
Fri Aug 06, 2010 2:03 pm

Nested Loops
-----------------------------------
//loop 1
while (stuff) {

     //loop 2
     while (other stuff) {

     }
     code
}

Assume that "stuff" and "other stuff" are true.
In order for "code" to be ran, does "other stuff" have to be false (thus ending loop 2)?

-----------------------------------
chrisbrown
Fri Aug 06, 2010 2:18 pm

RE:Nested Loops
-----------------------------------
Correct.

-----------------------------------
jbking
Fri Aug 06, 2010 6:20 pm

Re: Nested Loops
-----------------------------------
Unless you put a break in the inner loop which would then run the "code" part you highlight.  In other words, there is more than one way to get out of a while loop.

-----------------------------------
LeeShane
Wed Nov 17, 2010 3:36 am

RE:Nested Loops
-----------------------------------
see Loop goes to run until "stuff" or "other stuff" is true. you have to make it false if want to quit loop.
Both are in infinite loop
