SET.BREAK.HANDLER

SET.BREAK.HANDLER

Top  Previous  Next

 

The SET.BREAK.HANDLER statement allows a program to establish a handler subroutine that will be called if the user presses the break key.

 

 

Format

 

SET.BREAK.HANDLER name

 

where

 

nameevaluates to the name of the break handler. This must be a catalogued subroutine.

 

 

The break handler subroutine will be called if the break key is enabled and the user presses it. The subroutine takes a single argument through which it returns an action code telling QM how to handle the break. Possible return values are:

0Display normal break key action prompt
1Continue execution
2Quit (equivalent to use of STOP)
3Abort
4Logout

Any other value will display the normal break key action prompt.

 

The handler applies to the program that establishes it and to all programs called from it unless they establish their own break handler. The handler may perform any appropriate application processing to determine the action code to be returned but must not execute a STOP or ABORT statement internally.

 

The break handler will be deactivated when the program that established it terminates. The program can also use REMOVE.BREAK.HANDLER to deactivate the handler while the program continues to run. A program cannot remove the break handler of another program further down the call stack. On deactivation of a break handler, any handler belonging to a program further down the call stack becomes active again.

 

 

See also:

Interrupting commands, REMOVE.BREAK.HANDLER