If you want to stop the esc key from exiting the program, then do this type in this line of code
Now you can use make your own function to exit your program. i.e.
If KEYSTATE(1)=1 then END
this is saying if the [esc] button is pushed, then the program will exit(END is the function to terminate the program). You can change the key that induces the exit by using a different KEYSTATE() value. You can also add in a confirmation dialog, etc.
Hope this helps.
If you want fresh underwear in the morning, take it off the night before.