Guardian Programmer's Guide

Table Of Contents
Communicating With Terminals
Guardian Programmer’s Guide 421922-014
10 - 31
Selecting BREAK Mode
Reestablishing Normal Access and Normal Mode
Another call to SETMODE function 12 relinquishes BREAK access and BREAK mode,
returning the terminal status to normal access and normal mode. You achieve this by
setting parameter-1 and parameter-2 to zero:
LITERAL NORMAL^ACCESS = 0,
NORMAL^MODE = 0;
.
.
CALL SETMODE(HOME^TERM^NUM,
SET^ACCESS,
NORMAL^MODE,
NORMAL^ACCESS);
All types of access are now permitted to the terminal.
Returning BREAK to the Previous Owner
Finally, you should return BREAK to the previous owner using either SETPARAM
function 3 or SETMODE function 11:
CALL SETPARAM(TERM^NUM,
SET^BREAK^FUNCTION,
LAST^PARAM^ARRAY,
LAST^PARAM^COUNT);
Using BREAK Mode: An Example
In the following example, the SETPARAM call that establishes BREAK ownership also
sets BREAK mode and saves the identification and BREAK mode of the previous
owner. After enabling BREAK, this example checks $RECEIVE for Break-on-Device
messages. Normally, the process loops doing some computation, without any
interaction with the terminal user. Part of that loop checks $RECEIVE for the Break-
on-Device message. On receipt of a Break-on-Device message, the main procedure
calls the BREAK^IT procedure to process the Break-on-Device message.
?INSPECT, SYMBOLS
!Literals:
LITERAL SET^BREAK^FUNCTION = 3,
NORMAL^MODE = 0,
NEW^OWNER = 1,
BREAK^ACCESS = 12,
BREAK^ACCESS^ON = 1,
BREAK^ACCESS^OFF = 0,
BREAK^MODE = 1,
NOWAIT = 1,
MAXLEN = 256;