Computer Science Canada Repeat the loop |
Author: | ashan [ Thu Feb 19, 2004 7:07 pm ] |
Post subject: | Repeat the loop |
Hi, I'm a beginner in programming. Do any of you know how to repeat a loop (afterr you exit it) without cutting and pasting the whole loop command again?, is that the only way to do it? pls help me!! Thanks & regds Ashan |
Author: | Mazer [ Thu Feb 19, 2004 7:15 pm ] | ||
Post subject: | |||
It depends on how you want to do it. In some cases, you could just have the loop inside another loop. But that'd be weird for me to explain, and if you wanted to use the loop somewhere else instead of immediately after it finishes, that'd be useless. What I'm thinking would be best is to have a proc with the loop that you call whenever necessary.
|
Author: | RottenPunk [ Thu Feb 19, 2004 7:18 pm ] | ||
Post subject: | |||
im pretty new with turing too and i wasn't sure of a command to restart a loop in an if statement either but in one of my programs i fund that i put something like the following:
this tells the program that if the input is n or N than the program terminates but if anything else is typed the loop starts over. at leaset that is how mine works. hope that helps |
Author: | ashan [ Thu Feb 19, 2004 7:42 pm ] |
Post subject: | thanks, that works |
hey, thanks man! that works! u guys are great!! thanks again ashan |