Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 75
Using the SIO Procedures: An Example
!------------------------------------------------------------
! The following DEFINEs make it easier to format and print
! messages.
!------------------------------------------------------------
! Initialize a new line:
DEFINE START^LINE = @S^PTR := @SBUFFER #;
! Put a string into the line:
DEFINE PUT^STR(S) = S^PTR ':=' S -> @S^PTR #;
! Print the line:
DEFINE PRINT^LINE =
CALL WRITE^LINE(BUFFER,@S^PTR '-' @SBUFFER) #;
! Print a blank line:
DEFINE PRINT^BLANK =
CALL WRITE^LINE(BUFFER,0) #;
! Print a string:
DEFINE PRINT^STR(S) = BEGIN START^LINE;
PUT^STR(S);
PRINT^LINE; END #;
!------------------------------------------------------------
! Procedure to write a message on the terminal.
!------------------------------------------------------------
PROC WRITE^LINE(BUF,LEN);
INT .BUF;
INT LEN;
BEGIN
CALL WRITE^FILE(INFILE,BUF,LEN);
END;