Guardian Programmer's Guide

Table Of Contents
Interfacing With the ERROR Program
Guardian Programmer’s Guide 421922-014
20 - 10
Using the ERROR Process: An Example
! Loop while ERROR program still sending text:
EOF := 0;
WHILE NOT EOF DO
BEGIN
! Read the error-message text into the buffer:
CALL WRITEREADX(PROCNUM,S^STARTUP,0,132,COUNT^READ);
!Set flag if end of message text:
IF > THEN EOF := 1;
!Print buffer if not end of message text:
ELSE
BEGIN
CALL WRITEX(TERMNUM,S^STARTUP,COUNT^READ);
IF <> THEN
BEGIN
SBUFFER ':='
"Unable to communicate with Error process. "
-> @S^PTR;
CALL WRITEX(TERMNUM,SBUFFER,
@S^PTR '-' @SBUFFER);
CALL PROCESS_STOP_(PROCESS^HANDLE,
!specifier!,
ABEND);
CALL PROCESS_STOP_(!process^handle!,
!specifier!,
ABEND);
END;
END;
END;
! Close the ERROR process file:
CALL FILE_CLOSE_(PROCNUM);
! Stop the ERROR process:
CALL PROCESS_STOP_(PROCESS^HANDLE);
END;