Guardian Programmer's Guide

Table Of Contents
Using DEFINEs
Guardian Programmer’s Guide 421922-014
7 - 23
Using DEFINEs: An Example
! Display the error description on the terminal:
CALL WRITEX(TERMNUM,SBUFFER,@S^PTR '-' @SBUFFER);
IF <> THEN CALL FILE^ERRORS(TERMNUM);
END;
!-----------------------------------------------------------
! This procedure writes a message on the terminal and checks
! for any error. If there is an error, it attempts to write
! a message about the error and the program is stopped.
!-----------------------------------------------------------
PROC WRITE^LINE(BUF,LEN);
STRING .BUF;
INT LEN;
BEGIN
CALL WRITEX(TERMNUM,BUF,LEN);
IF <> THEN CALL FILE^ERRORS(TERMNUM);
END;