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

Username:   Password: 
 RegisterRegister   
 Is there an exit Command to just close the program?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
tristanbryce7




PostPosted: Wed Jan 23, 2013 5:38 pm   Post subject: Is there an exit Command to just close the program?

Hey, i was just wondering if there was a line in command in turing that just closes the program, nothing else, I know that if you're doing linear programming you can use "exit" (considering your last bit of code is in a loop), and also know that "return" command can sometimes work (I say sometimes b/c sometimes if I go from proc to proc to proc to .... it doesn't work) and I know that the "quit" command closes the program w/o fail, but it also goes back to the turing code and highlights the bit of code containing "quit" and looks "unclean". So i was wondering basically what line of code can just stop the program (like quit does but w/o the after effects)
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Jan 23, 2013 6:22 pm   Post subject: RE:Is there an exit Command to just close the program?

quit throws an exception, which (if not caught) pops off the entire stack, getting you to the end of the program really fast. Since the exception wasn't caught, the reasonable thing is to show where it originated, for the debugging purposes...

I'm not sure what the answer is, but I wonder how this behaves from a compiled/stand-alone program.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
tristanbryce7




PostPosted: Wed Jan 23, 2013 6:33 pm   Post subject: Re: Is there an exit Command to just close the program?

Ah i see, I guess the only thing I can do is stay with quit lol
chrisbrown




PostPosted: Wed Jan 23, 2013 7:06 pm   Post subject: RE:Is there an exit Command to just close the program?

Tony: http://i.imgur.com/Th3J16f.png
Tony




PostPosted: Wed Jan 23, 2013 8:58 pm   Post subject: RE:Is there an exit Command to just close the program?

ah, thx!

Guess you'd have to place a handler at the bottom of the stack to catch quit and exit gracefully.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
tristanbryce7




PostPosted: Thu Jan 24, 2013 7:46 am   Post subject: Re: Is there an exit Command to just close the program?

There's never a simple solution, sigh. And you'd think Turing has an option which just closes the problem lol
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  [ 6 Posts ]
Jump to:   


Style:  
Search: