Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 29
Changing the Interactive Read Prompt
Writing Records With SIO Procedures
To write a record to a file, you must supply the WRITE^FILE procedure with the name
of the FCB of the file to write to and of the buffer that contains the record to be written:
CALL WRITE^FILE(OUTFILE,
WRITE^BUFFER,
WRITE^COUNT);
Changing the Interactive Read Prompt
Normally, a READ^FILE call against a terminal file displays a question mark (?)
character on the terminal to prompt for input. (Internally, the SIO routine is actually
executing a WRITEREAD procedure call.) You can change the prompt to one of the
following:
An alternate character specified in the prompt-char parameter of the
OPEN^FILE procedure
An alternate character specified by a SET^FILE SET^PROMPT operation
A string of characters supplied to the READ^FILE procedure
The following example uses the OPEN^FILE procedure to change the interactive
prompt to a colon:
PROMPT^CHAR ':=' ":";
CALL OPEN^FILE(COMMON^FCB,
INPUT,
INBLKBUF,
INBLKLEN,
!flags!,
!flags^mask!,
!max^recordlen!,
PROMPT^CHAR);
The next example does the same using the SET^FILE procedure:
NEW^PROMPT ':=' ":";
CALL SET^FILE(INPUT,
SET^PROMPT,
NEW^PROMPT);
To issue a multiple-character prompt, you set the prompt in the read buffer and then
issue the READ^FILE procedure call. The prompt-count parameter specifies how
many characters to write to the terminal from the read buffer. For example:
BUFFER ':=' "Press 'y' or 'n': ";
PROMPT^COUNT := 18;
CALL READ^FILE(INPUT,
BUFFER,RCOUNT,PROMPT^COUNT);
Note that the prompt is overwritten by the text returned in the read buffer.