Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 68
Writing the Program
!------------------------------------------------------------
! Procedure to perform initialization for the program. It
! calls INITIALIZER to read and copy the Startup message
! into the global variables area and then opens the IN file
! specified in the Startup message. This procedure also
! checks whether labeled tape support is turned on.
!------------------------------------------------------------
PROC INIT;
BEGIN
INT OPEN^FLAG;
INT ERROR;
INT RETURNED^VALUE;
INT .TERM^NAME[0:MAXFLEN - 1];
INT TERMLEN;
! Read and save the Startup message:
CALL INITIALIZER(!rucb!,
!passthrough!,
SAVE^STARTUP^MESSAGE);
! Open IN file:
ERROR := OLDFILENAME_TO_FILENAME_(
CI^STARTUP.INFILE.VOLUME,
TERM^NAME:MAXFLEN,TERMLEN);
IF ERROR <> 0 THEN CALL PROCESS_STOP_(!process^handle!,
!specifier!,
ABEND);
ERROR := FILE_OPEN_(TERM^NAME:TERMLEN,TERMNUM);
IF <> THEN CALL PROCESS_STOP_(!process^handle!,
!specifier!,
ABEND);
! Check if labeled tape support is turned on. Print a
! message and stop the program if not:
RETURNED^VALUE := LABELEDTAPESUPPORT;
IF RETURNED^VALUE = 0 THEN
BEGIN
PRINT^STR("Labeled tape support is not enabled. ");
CALL PROCESS_STOP_(!process^handle!,
!specifier!,
ABEND);
END;
END;