Computer Science Canada loop within a loop |
Author: | n00b.skillz [ Sat Jan 13, 2007 5:52 pm ] |
Post subject: | loop within a loop |
okay well i need to make a loop within a loop but i need to be able for the loops to be different...somehow... as i am ending both loops with exit when and the one loop starts the line before the other... any suggestions? is there anyway i can make the loops distinct as in loop1 and loop2 and then exit loop1 when... exit loop2 when... that sorta of thing..... is this possible? |
Author: | neufelni [ Sat Jan 13, 2007 6:36 pm ] | ||
Post subject: | RE:loop within a loop | ||
Yes this is possible. Here is an example program. It counts to 5 three times.
So basically you just have an outer loop and an inner loop. The first exit when is for the inner loop and the second one is for the outer loop. |
Author: | n00b.skillz [ Sat Jan 13, 2007 7:25 pm ] |
Post subject: | Re: loop within a loop |
yea thanks alot i tried this before but it wasn't working and now i tried it again and it works... i must've keyed in something wrong by accident before... thanks for clearing this up! ![]() |