Guardian Programmer's Guide

Table Of Contents
Writing a Server Program
Guardian Programmer’s Guide 421922-014
22 - 53
The Order-Query Server ($SER3)
! 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; #;
!------------------------------------------------------------
! Procedure for displaying file-system error numbers on the
! terminal. The parameters are the file name and its length
! and the error number. This procedure is used when the
! file is not open, so there is no file number for it.
!
! The procedure also stops the program after displaying the
! error message.
!------------------------------------------------------------
PROC FILE^ERRORS^NAME(FNAME:LEN,ERROR);
STRING .FNAME;
INT LEN;
INT ERROR;
BEGIN
! Compose and print the message:
START^LINE;
PUT^STR("File system error from $SER1 ");
PUT^INT(ERROR);
PUT^STR(" on file " & FNAME FOR LEN);
CALL WRITEX(TERM^NUM,SBUFFER,@S^PTR '-' @SBUFFER);
! Terminate the program:
CALL PROCESS_STOP_;
END;