Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 55
Writing the Program
BEGIN
INT MSGCODE;
STRUCT DEFAULT;
BEGIN
INT VOLUME[0:3];
INT SUBVOL[0:3];
END;
STRUCT INFILE;
BEGIN
INT VOLUME[0:3];
INT SUBVOL[0:3];
INT FILEID[0:3];
END;
STRUCT OUTFILE;
BEGIN
INT VOLUME[0:3];
INT SUBVOL[0:3];
INT FILEID[0:3];
END;
STRING PARAM[0:529];
END;
?NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS0(INITIALIZER,
? FILE_OPEN_,WRITEREADX,WRITEX,PROCESS_STOP_,READX,CONTROL,
? DNUMOUT,FILE_GETINFO_,DNUMIN,SETMODE,LABELEDTAPESUPPORT,
? OLDFILENAME_TO_FILENAME_,FILE_CLOSE_)
?LIST
!------------------------------------------------------------
! 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 =