Guardian Programmer's Guide

Table Of Contents
Manipulating File Names
Guardian Programmer’s Guide 421922-014
13 - 38
Manipulating File Names: An Example
!------------------------------------------------------------
! Procedure to perform initialization for the program.
!------------------------------------------------------------
PROC INIT;
BEGIN
STRING .OUT^NAME[0:MAXLEN - 1]; !string form of OUT file
! name
INT OUTNAME^LEN; !length of OUT file
! Call INITIALIZER to read and save the Startup message:
CALL INITIALIZER(!rucb!,
!passthru!,
START^IT);
! Convert the output file name:
ERROR := OLDFILENAME_TO_FILENAME_(
CI^STARTUP.OUTFILE.VOLUME,
OUT^NAME:MAXLEN,
OUTNAME^LEN);
IF ERROR <> 0 THEN CALL FILE^ERRORS(ERROR);
! Open the output file:
ERROR := FILE_OPEN_(OUT^NAME:OUTNAME^LEN,OUTNUM);
IF ERROR <> 0 THEN CALL FILE^ERRORS(ERROR);
END;