roadrunner116 0 Posted October 18, 2015 Share Posted October 18, 2015 Hi, how do I terminate my program, so the user is able to get back to openOS? Thanks! Quote Link to post Share on other sites
0 Gangsir 14 Posted October 23, 2015 Share Posted October 23, 2015 Press CTRL+ALT+C. Or, reboot the PC. Inside your code, you can also use os.exit() Quote Link to post Share on other sites
0 roadrunner116 0 Posted October 27, 2015 Author Share Posted October 27, 2015 Sorry. Like i wrote in my other post, I was away for a week. Those three way are the ways I know. I would like to Terminate the script from inside my code, but os.sleep() just does nothing. This is the way I tried to close the Application. function buttonConfTerm(name, data, playerName) gui.flashButton(name,0.1,2) os.exit() end The button flashes and if I put in a print() it also prints my text. So the touch-event handling seems to work Quote Link to post Share on other sites
0 mpmxyz 27 Posted October 28, 2015 Share Posted October 28, 2015 Is this function called within an event handling function or do you handle events "manually" in your main loop? os.exit() internally works by throwing an error. Due to that it isn't working within event listeners. (Listener errors are just written to a file and not forwarded to the main code.) If you want it to work correctly you have to have some kind of variable like "keepRunning" that finishes your main loop when changed. By the way: Don't forget to event.ignore before stopping your program! Quote Link to post Share on other sites
Hi,
how do I terminate my program, so the user is able to get back to openOS?
Thanks!
Link to post
Share on other sites