
6.MACRO EXECUTOR FUNCTION B-63943EN-2/01
- 244 -
Opening a file
Function This command opens a file.
Format FOPEN (file-number, access-mode, status-variable-number)
Explanation The <file-number> parameter specifies a file to be opened.
See Table 6.13.6 (a) for the values that can be used as file
numbers.
The <access-mode> parameter specifies a read or write
mode. See Table 6.13.6 (b) for the access mode values that
can be specified.
The <status-variable-number> parameter specifies the macro
variable number to which the execution result of the
command is returned. The user must check this value. See
Table 6.13.6 (e) for the status values.
This status variable number is valid also for FCLOS, FREAD,
FWRIT, and FPSET.
Caution Up to 10 files can be open at the same time.
The file open command cannot be executed for a file that is
already open.
Sample
statement
FOPEN (200,1,100)
This statement opens file No. 200 in both write and read
modes. The result of executing the statement is returned to
macro variable #100.
Closing a file
Function This command closes a file.
Format FCLOS (file-number)
Explanation The <file-number> parameter specifies a file to be closed.
See Table 6.13.6 (a) for the values that can be used as file
numbers.
The result of executing this command is returned to the
macro variable number specified in FOPEN. The user must
check this value. See Table 6.13.6 (e) for the status values.
Sample
statement
FCLOS (200)
This statement closes file No. 200. The result of executing
this statement is returned to the status variable number
specified when the file was opened.