Guardian Programmer's Guide

Table Of Contents
Using Nowait Input/Output
Guardian Programmer’s Guide 421922-014
4 - 13
Nowait I/O: An Example
!------------------------------------------------------------
! Here are some DEFINEs to make it easier to format and
! print messages.
!------------------------------------------------------------
! Initialize for a new line:
DEFINE START^LINE = @S^PTR := @SBUFFER #;
! Put a string into the line:
DEFINE PUT^STR(S) = S^PTR ':=' S -> @S^PTR #;
! Put an integer into the line:
DEFINE PUT^INT(N) =
@S^PTR := @S^PTR '+' DNUMOUT(S^PTR,$DBL(N),10) #;
! Print the line:
DEFINE PRINT^LINE =
CALL WRITE^LINE(SBUFFER,@S^PTR '-' @SBUFFER) #;
! Print a blank line:
DEFINE PRINT^BLANK =
CALL WRITE^LINE(SBUFFER,0) #;
! Print a string:
DEFINE PRINT^STR(S) = BEGIN START^LINE;
PUT^STR(S);
PRINT^LINE; END #;