READ_FILE
Reads a file you specify, adding its contents before the current line
in the current buffer; optionally returns a string containing the file
specification of the file to be read. DECTPU displays a message
indicating how many records (lines) were read.
Syntax
[string2 :=] READ_FILE (string1)
Parameters
string1 Specifies the file you want to read into the current buffer.
Examples
1. READ_FILE ("SYS$LOGIN:LOGIN.COM");
Reads your login file from your top-level, login directory, adding
its contents to the current buffer.
2. The following procedure creates a second window and a second
buffer, maps the window to the screen, and prompts the user to
specify the file to include in the buffer:
PROCEDURE user_edit_second_file
window2 := CREATE_WINDOW (1, 10, ON);
buffer2 := CREATE_BUFFER ("second_buffer");
MAP (window2, buffer2);
READ_FILE (READ_LINE ("Enter file name for 2nd window: "));
POSITION (BEGINNING_OF (buffer2));
ENDPROCEDURE;
Related topics
CREATE_BUFFER CURRENT_BUFFER MOVE_TEXT WRITE_FILE