Author |
Message |
w00tw00t
|
Posted: Tue Sep 28, 2004 9:18 am Post subject: Restart the program? |
|
|
Hey im making a program right now that puts stuff in arrays and out to a file and other junk like that. I was wondering what the code would be to start the program over again without having to exit and go back into it? Thanks. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
apomb
|
Posted: Tue Sep 28, 2004 9:55 am Post subject: (No subject) |
|
|
put the whole thing into a loop and when the program comes to the end
code: |
var yn : string
loop
%your program here
would you like to restart? (y/n)
get yn
exit when yn = "n"
end loop
|
|
|
|
|
|
|
w00tw00t
|
Posted: Tue Sep 28, 2004 10:41 am Post subject: (No subject) |
|
|
thanks man, dont know why i didnt think of it X| lol i guess i was just hoping there was a command for it. |
|
|
|
|
|
Paul
|
Posted: Tue Sep 28, 2004 2:28 pm Post subject: (No subject) |
|
|
Well you could have procedures and then clear the variables when the program is done, then call the procedure again, if you're only starting it over once, if you want to do it multiple times, you still need a loop. |
|
|
|
|
|
Flea
|
Posted: Fri Oct 08, 2004 8:51 pm Post subject: (No subject) |
|
|
if youre only repeating the program once, you could use a for loop.
for i : 1 .. 2
(program here)
end for |
|
|
|
|
|
|