Guardian Programmer's Guide

Table Of Contents
Communicating With Terminals
Guardian Programmer’s Guide 421922-014
10 - 24
Managing the BREAK Key
simply checks the $RECEIVE file for system message -105 (Break-on-Device
message).
You can use BREAK in conversational or page mode.
To write programs that manage the BREAK key, you need to perform some of the
following tasks:
Enable BREAK by taking ownership of the BREAK key
Receive and process message -105 (the Break-on-Device message)
Reestablish BREAK ownership after receiving the Break-on-Device message
Establish BREAK mode
Interpret BREAK-related errors
The above tasks are outlined below. The remainder of this subsection describes in
detail how to perform these tasks.
To enable BREAK and perform its own BREAK handling, your program must take
ownership of the BREAK key. You should be aware of the following:
You establish BREAK ownership using either SETPARAM function 3 or SETMODE
function 11. We recommend using the SETPARAM procedure because only that
procedure allows you specify a break tag value so that you can distinguish
between subdevices when a BREAK occurs.
Only one process can own the BREAK key at a time.
If the terminal was opened by the backup process of a process pair, the backup
process automatically becomes the BREAK owner if its primary process fails while
owning BREAK.
If BREAK is not enabled, then the BREAK key is ignored.
If the process that owns BREAK is deleted or fails, BREAK ownership is lost. That
is, no process is informed if the BREAK key is pressed.
To receive system message -105 (the Break-on-Device message), your
process
must have BREAK enabled. Receiving the Break-on-Device message indicates that
the BREAK key has been pressed.
See the Guardian Procedure Errors and Messages Manual for details on the Break-on-
Device message structure.
To reestablish BREAK ownership after receiving the Break-on-Device message,
your process must either issue a READ or WRITEREAD procedure call to the terminal
or reissue the SETPARAM or SETMODE request that establishes BREAK ownership.
When the BREAK key is pressed, the BREAK feature is no longer enabled; if the
BREAK key is pressed again, it is ignored. You should therefore reestablish BREAK
ownership.