Computer Science Canada

how do i exit the program?

Author:  greenapplesodaex [ Tue Jun 08, 2004 12:46 pm ]
Post subject:  how do i exit the program?

i'm making this program where if you click "exit" button, it shuts doesn the program. someone told me to use "quit", it works, but then it gives me some kinda of error. does anyone know the commend for shuting down a program?

Author:  Neja [ Tue Jun 08, 2004 1:04 pm ]
Post subject: 

Try opening a Window at the beging of your program and when you quit the game, close the window.

Author:  greenapplesodaex [ Tue Jun 08, 2004 1:19 pm ]
Post subject:  reply

o, haha, my program is mulitiple windows, but you cant close the default window

Author:  Neja [ Tue Jun 08, 2004 1:33 pm ]
Post subject: 

Okay, well, then open the default (I'm doing this), or, I don't recomend it but, use GUI, OR, if you use quit, make an if statement which checks for the error and then choose whatever action,. I hope that made snese...

Author:  Cervantes [ Tue Jun 08, 2004 2:52 pm ]
Post subject: 

i don't think it gives you an error exactly, it just highlights the quit line because that's where the program stopped.

to close the default window, you have to use a Window.Open at the start

you can do it like this:
code:
var winID := Window.Open ("graphics:500;500,title:Window Closing,nobuttonbar")
var keys : array char of boolean

loop
    Input.KeyDown (keys)
    exit when keys (KEY_ESC)
end loop
Window.Close (winID)

Author:  greenapplesodaex [ Tue Jun 08, 2004 3:45 pm ]
Post subject:  reply

um... if you compile it, and do the quit thing, it gives you an error

Author:  AsianSensation [ Tue Jun 08, 2004 3:55 pm ]
Post subject: 

return instead of quit

Author:  greenapplesodaex [ Tue Jun 08, 2004 6:01 pm ]
Post subject:  reply

you da man!


: