DGL Statement Reference : OPEN

OPEN

Description
Opens files or the dialog area so text can be written to or read from them.
This statement is used with mode=OUTPUT to open a file or the dialog area so that a subsequent WRITE statement can pass text to it, and with mode=INPUT for a subsequent READ statements.
When writing to the dialog area, the syntax is as follows:
OPEN (fl, ’DIALOG’, OUTPUT);
Syntax
OPEN (fl, file_name, mode [, status]);
Parameters
 
An identifier of type FILE, assigned by the OPEN statement.
The name of the file to (or from) which to pass the text, or the dialog area. If the file opened for output does not exist, this statement creates a new file. If the file exists, the OPEN statement overwrites the existing contents of the file.
To open the dialog area, use the string ‘DIALOG’ (with apostrophes) for this parameter. Open the dialog area so you can pass run-time messages to it.
If mode=OUTPUT, the OPEN statement opens a file or the dialog area so a subsequent WRITE statement can pass text to it.
If mode=INPUT, the OPEN statement opens a file or the dialog area so a subsequent READ statement can pass text to it.
stm_success—Successful execution of the statement.
stm_error—Failure.
Notes
The name of the file is specified in accordance with the conventions of the operating system. If the directory is not specified as part of the file name, the workarea is searched for the file. If the file opened for output does not exist, this statement creates a new file. If the file exists, it is initialized by the OPEN statement (the written information overwrites the existing contents of the file).
See Also

CLOSE

READ

VARIABLE Statement