Guardian Programmer's Guide

Table Of Contents
Writing a Terminal Simulator
Guardian Programmer’s Guide 421922-014
24 - 15
Sending Break-on-Device Messages
When the user presses the BREAK key, the terminal simulator might enter BREAK
mode, depending on the value of the param2 parameter on the last call to SETMODE
function 11 or word 1 of the param-array parameter passed to the last call to
SETPARAM function 3.
Sending Break-on-Device Messages
The terminal-simulation process can send Break-on-device messages to requesters.
To simulate a terminal accurately, the terminal-simulation process should send Break-
on-device messages only to the current BREAK key owner.
To send a Break-on-device message to another process, call the
BREAKMESSAGE_SEND_ procedure. To do this, you need to identify the requester
process by its process handle, as well as give the file number by which the requester
has the terminal-simulation process open. Both the process handle and the file
number are available using FILE_GETRECEIVEINFO_ on receipt of the SETPARAM
function 3 message or SETMODE function 11 message. For example:
PROCESS^HANDLE ':=' RECEIVE^INFO[0] FOR 10;
FILE^NUM := RECEIVE^INFO[3];
ERROR := BREAKMESSAGE_SEND_(PROCESS^HANDLE,FILE^NUM);
This procedure sends a Break-on-device message to the process whose process
handle is stored in PROCESS^HANDLE.
The Break-on-device message sent by this procedure has the following format:
For a complete description of the BREAKMESSAGE_SEND_ procedure, see the
Gu
ardian Procedure Calls Reference Manual.
Structure of Break-on-device message (system message -105):
sysmsg[0] = -105
sysmsg[1] = file number of receiver’s open file to the
terminal that indicated BREAK
sysmsg[2] = first BREAK tag word
sysmsg[3] = second BREAK tag word