Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Restart the program?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
w00tw00t




PostPosted: 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
Sponsor
sponsor
apomb




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: