Guardian Programmer's Guide

Table Of Contents
Communicating With Terminals
Guardian Programmer’s Guide 421922-014
10 - 35
Selecting BREAK Mode
! Loop indefinitely, checking for Break-on-Device message:
WHILE 1 = 1 DO
BEGIN
! Issue a nowait read on $RECEIVE:
CALL READ(RECV^NUM,RECV^BUF,132);
ERROR := 0;
LOOP := 40;
! Loop until nowait read finishes:
WHILE LOOP = 40 DO
BEGIN
!Check for completion of read operation. Return
!immediately if incomplete:
CALL AWAITIO(RECV^NUM,
!buffer^address!,
BYTES^READ,
!tag!,
0D);
IF = THEN
BEGIN
! Process user message
.
.
END;
! Check if system message:
IF > THEN
BEGIN
! Check if Break-on-Device message:
IF RECV^BUF = -105 THEN
CALL BREAK^IT
ELSE
BEGIN
! Process other system message
.
.
END;
END
! Else AWAITIO returned with an error:
ELSE CALL FILE_GETINFO_(RECV^NUM,ERROR);
LOOP := ERROR;