The OPTIONS CLOSE APPLICATION instruction defines the callback function in case of front-end termination.
OPTIONS ON CLOSE APPLICATION CALL function
The OPTIONS ON CLOSE APPLICATION CALL function can be used to execute specific code when the front-end stops. For example, when the front-end program is stopped, when the user workstation session is ended, or when the workstation is shut down.
Before stopping, the front-end sends a internal event that is trapped by the runtime system. When a callback function is specified with this program option command, the application code that was executing is canceled, and the callback function is executed before the program stops.
Use the OPTIONS ON CLOSE APPLICATION CALL function instruction with care, and do not execute complex code in the callback function. The code should only contain simple and short cleanup operations; Any interactive instruction must be avoided.
A front-end program crash or network failure is not detected and cannot be handled by this instruction.