
B-63943EN-2/01 6.MACRO EXECUTOR FUNCTION
- 245 -
Reading data from a file
Function This command reads the contents of a file.
Format FREAD (file-number, data-type, data-variable-number)
Explanation The <file-number> parameter specifies a file to be read from.
See Table 6.13.6 (a) for the values that can be used as file
numbers.
The <data-type> parameter specifies the type of the data to
be read. See Table 6.13.6 (c) for the data type values.
The <data-variable-number> parameter specifies the number
of the macro variable to which the read data is to be
assigned.
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.
Caution After data is read, its pointer is updated automatically.
Sample
statement
FREAD (200,2,500)
The data currently indicated by the pointer of file No. 200 is
read in binary form 1 (word type) and assigned to macro
variable #500. The result of executing this statement is
returned to the status variable number specified when the file
was opened.
Writing data to a file
Function This command writes data to a file.
Format FWRIT (file-number, data-type, data)
Explanation The <file-number> parameter specifies a file to be written
to. See Table 6.13.6 (a) for the values that can be used as
file numbers.
The <data-type> parameter specifies the type of the data to
be written. See Table 6.13.6 (c) for the data type values.
The <data> parameter specifies the data to be written.
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.
Caution After data is written, its pointer is updated automatically.
Sample
statement
FWRIT (200,2,123)
The data 123 is written to a location currently indicated by
the pointer of file No. 200 in binary form 1 (word type). The
result of executing this statement is returned to the status
variable number specified when the file was opened.