BREAK - establish a user "break" key handler.


external handlr
call break(handlr)


is a subroutine with no arguments.


BREAK establishes "handlr" as a routine to be called the "break" key is hit in a TSS program. When "handlr" returns, the program resumes where it was interrupted. If BREAK is not used, the "break" key will terminate the program abruptly without closing files properly.


The runtime library is not re-entrant, so there is little that "handlr" can do except set a flag variable in a common area and return. In particular, it cannot do any I/O, do STOP or PAUSE, or do exponentiation. It can call BREAK, NBREAK, BRKMSG or NBRKS.

A subtle implication of this is that "handlr" must be compiled with the PARCHK option turned off.

Since the system maintains a break count, it would be reasonable for "handlr" to do nothing except an immediate return.

If the "break" key is pressed while waiting for terminal input, the input will be treated as an end-of-file condition after the break is serviced, and the END= return will be taken, if present.

In an overlaid program, "sub" must be in the root overlay.

A interactive DML program must use BREAK to ensure that the program is not prematurely terminated without the IDS/II routines having a chance to properly clean up.

See Also:

expl f77 lib brkmsg
for how to get a break acknowledgment printed to the user.
expl f77 lib nbreak
for how to stop handing breaks.
expl f77 lib nbrks
for how to check the number of time break was hit.

Copyright © 1996, Thinkage Ltd.