Guardian Programmer's Guide

Table Of Contents
Formatting and Manipulating Character Data
Guardian Programmer’s Guide 421922-014
19 - 45
Editing a Character String
!------------------------------------------------------------
! Procedure to save the Startup message in a global
! structure.
!------------------------------------------------------------
PROC SAVE^STARTUP^MESSAGE(RUCB,START^DATA,MESSAGE,LENGTH,
MATCH) VARIABLE;
INT .RUCB,
.START^DATA,
.MESSAGE,
LENGTH,
MATCH;
BEGIN
! Copy the Startup message into the CI^STARTUP structure:
CI^STARTUP.MSGCODE ':=' MESSAGE[0] FOR LENGTH/2;
END;
!------------------------------------------------------------
! Procedure to open the terminal file specified in the IN
! file of the Startup message.
!------------------------------------------------------------
PROC INITIALIZE^TERMINAL;
BEGIN
STRING .TERM^NAME[0:MAXFLEN - 1];
INT TERMLEN;
INT ERROR;
! Read and save the Startup message:
CALL INITIALIZER(!rucb!,
!passthru!,
SAVE^STARTUP^MESSAGE);
! Open the 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,TERM^NUM);
IF ERROR <> 0 THEN CALL PROCESS_STOP_(!process^handle!,
!specifier!,
ABEND);
END;