Posted: Tue May 26, 2009 11:04 am Post subject: need help closing program
OK we have a program that were doing for a project. In the program in the Main Menu we have a quit button that just minimizes the window and stops the program, but we need it to close the window completely. I've seen someone's program that does that but he/she still use the "quit" command... I just don't get it
Sponsor Sponsor
Siavash
Posted: Tue May 26, 2009 12:03 pm Post subject: RE:need help closing program
try GUI.QUIT
it works in my program
BigBear
Posted: Tue May 26, 2009 2:31 pm Post subject: RE:need help closing program
GUI.QUIT probably quits the GUI module
quit crashes the program which is no what you want to use
Once a program has no more code it will finish so without a loop it will read the code and finish when it is done reading
But a loop without an exit statement will continue forever and never finish unless you close it or end application etc
You need to exit your main loop with the options to play
Turing:
loop put Instructions
get input
if input ="1"then play endif exitwhen input ="2" endloop
You can also put exit in an if condition
Dusk Eagle
Posted: Tue May 26, 2009 2:56 pm Post subject: Re: need help closing program
Posted: Tue May 26, 2009 4:07 pm Post subject: RE:need help closing program
Make sure you use window.Close after all of your other code don't try to use this to quit the program
for example
Turing:
loop get input
if input ="q"then Window.Close(winID) endif endloop
Turing will not exit the loop and will say I need to get input with a cursor so and will open the default window again.
You can close your program and see which line says program interrupted and see why it is there when it should be finished, probably need to exit a loop