Guardian Programmer's Guide

Table Of Contents
Communicating With Terminals
Guardian Programmer’s Guide 421922-014
10 - 32
Selecting BREAK Mode
!Global variables:
STRING .HOME^TERM[0:MAXLEN -1], !terminal file name
.RECV^FILE[0:7]
:= "$RECEIVE"; !$RECEIVE file name
INT HOME^TERM^NUM, !terminal number
.BUFFER[0:127], !buffer for terminal I/O
RCOUNT, !max bytes read
WCOUNT, !count of bytes to write
ERROR, !file-system error number
BYTES^READ, !number of bytes read
.PARAM^ARRAY[0:3], !input to SETPARAM
PARAM^COUNT, !length of PARAM^ARRAY
.LAST^PARAM^ARRAY[0:3], !values for last owner
LAST^PARAM^COUNT, !size of last-param-array
.RECV^BUF[0:66], !buffer for $RECEIVE
! messages
RECV^NUM, !file number for $RECEIVE
LOOP, I,J; !computation variables
STRING .FIRST^BYTE := @BUFFER '<<' 1; !string pointer to
! BUFFER
?NOLIST
?SOURCE $SYSTEM.SYSTEM.EXTDECS(PROCESS_GETINFO,FILE_OPEN_,
? WRITE,READ,WRITEREAD,FILE_GETINFO_,
? PROCESS_STOP_,DEBUG,SETPARAM,
? AWAITIO,INITIALIZER,SETMODE)
?LIST
?NOMAP,NOCODE
!------------------------------------------------------------!
Procedure to process Break-on-Device message. This
! procedure prompts the user for input and then echoes the
! input back to the terminal. If the user types "exit," then
! the process terminates. If the user types "resume," then
! the process returns to computational mode until the BREAK
! key is pressed again. For any other user response, this
! procedure displays the prompt.
!------------------------------------------------------------
PROC BREAK^IT;
BEGIN
WHILE 1 DO
BEGIN
! Establish BREAK access:
CALL SETMODE(HOME^TERM^NUM,BREAK^ACCESS,
!param1,
BREAK^ACCESS^ON);