the outer loop will be the first one to trigger then the inner loop. until the inner loop is not done it will continue until its done then back to the outer loop then continue to process.
2006-08-06 16:38:54
·
answer #1
·
answered by kryptonboy22 3
·
0⤊
0⤋
I give you an example, may be helpful to understand. Let us say outer loop is to write its execution turn like 1, 2, 3, ... and to execute inner loop. Outer loop executes 5 times. And the inner loop is to write a, b, c, ... up to h. The result will be some thing like this:
1
a b c d e f g h
2
a b c d e f g h
3
a b c d e f g h
4
a b c d e f g h
5
a b c d e f g h
Probably now you will understand how they work.
2006-08-06 17:22:38
·
answer #2
·
answered by Happy Smile 1
·
0⤊
0⤋
It will execute the top of the outermost loop until it gets to the innermost for loop, then it will push the stack (locally declared variables and other state information), and execute the innermost for loop until the condition for the inner loop ends. Then it will return to the previous stack state and continue executing the outer loop, which will trigger the inner loop again, causing it to execute, and so on.
2006-08-06 16:36:28
·
answer #3
·
answered by Don M 7
·
0⤊
0⤋
If i remember from my visual basic class correctly, the outter one would be triggered first. The outter one is only triggered once then the outter loop is triggered until it meets its constraints (ie x=4) then the outter loop is tested once more then the next loop is again goes through until its done then back to the outter loop. The whole process is done whenever the outter loop meets its constraints.
2006-08-06 16:37:33
·
answer #4
·
answered by Jason 3
·
0⤊
0⤋
here's an example..
for ($i=0;$i<=10;$i++) { // loop 1
// this loop executes any instructions, including loop 2
for ($x=0;$x<=10;$x++) { // loop 2
// this loops executes any instructions, including loop 3
for ($y=0;$y<=10$y++) { // loop 3
// this loop executes any instructions until $y == 10/
// when 4y == 10, it drops back to loop 2, and this gets executed again
// when $x == 10, loop 1 executes again, causing loop 2 to execute, and then loop 3. this continues until $i == 10
}
}
}
here, i even setup a visual..
http://evildomain.org/loops.php
2006-08-06 17:13:46
·
answer #5
·
answered by duct_tape_is_good 4
·
0⤊
0⤋
the loops finish from inside to out.
2006-08-06 16:35:36
·
answer #6
·
answered by Daniel H 5
·
0⤊
0⤋
outer loop
2006-08-06 19:49:39
·
answer #7
·
answered by JNz30_0 2
·
0⤊
0⤋