|Navigation: Language Reference > 13 - Built-in Functions >====== SHUTDOWN (arm termination procedure) ======|
|SHUTDOWN||Arms a procedure which is called when the program terminates.|
|procedure||The label of a PROCEDURE. If omitted, the SHUTDOWN process is disarmed.|
The SHUTDOWN statement arms a procedure which is called when the program terminates. The shutdown procedure is called by normal program termination or by an abnormal-end/run-time halt. It may not be able to execute for an abnormal-end/run-time halt, depending upon the state of the system resources at the time of the crash. It is not called if the computer is rebooted or the program is terminated due to power failure. The same effect as SHUTDOWN can be more safely achieved by simply calling a procedure to execute on EVENT:CloseDown for the application frame.
SHUTDOWN(CloseSys) !Arm CloseSys as the shutdown procedure