Guardian Programmer's Guide

Table Of Contents
Communicating With Terminals
Guardian Programmer’s Guide 421922-014
10 - 30
Selecting BREAK Mode
Establishing BREAK Mode
To establish BREAK mode, you must specify BREAK mode when enabling BREAK.
Doing this tells the system to put the terminal into BREAK mode when the BREAK key
is pressed. Once BREAK mode is established, only file operations having BREAK
access are allowed access to the terminal.
The following example enables BREAK. The second word of the param-array
specifies BREAK mode:
LITERAL SET^BREAK^FUNCTION = 3,
BREAK^MODE = 1,
TAKE^BREAK = 1;
INT .PARAM^ARRAY[0:3];
INT PARAM^COUNT;
INT .LAST^PARAM^ARRAY[0:3];
INT LAST^PARAM^COUNT;
.
.
PARAM^ARRAY[0] := TAKE^BREAK;
PARAM^ARRAY[1] := BREAK^MODE;
PARAM^ARRAY[2] := 0;
PARAM^ARRAY[3] := 0;
PARAM^COUNT := 8;
CALL SETPARAM(TERM^NUM,
SET^BREAK^FUNCTION,
PARAM^ARRAY, !word 1 specifies BREAK mode
PARAM^COUNT
LAST^PARAM^ARRAY,
LAST^PARAM^COUNT);
Establishing BREAK Access
When the system puts the terminal into BREAK mode, any operations on the terminal,
even those from the owner of BREAK, are rejected unless the program making the
access has put itself into BREAK access mode. By convention, only the owner of
BREAK is supposed to do that, hence this mechanism ensures that when the terminal
user presses BREAK, the BREAK owner can respond.
Use SETMODE function 12 to establish BREAK access to the terminal. Once BREAK
access is established, the application process can communicate with the terminal in
the usual way.
The following statement establishes BREAK access:
LITERAL BREAK^ACCESS = 1;
LITERAL SET^ACCESS = 12;
.
.
CALL SETMODE(HOME^TERM^NUM,
SET^ACCESS,
!param1!,
BREAK^ACCESS);