- 8 -
File input/output
Statement
OPEN Format OPEN <file designation> [FOR <file mode> ] AS [#] <file number>
[LEN= <record length> ]
Function Opens a file.
CLOSE Format CLOSE [ [#] <file number> [, [#] <file number> ] ···]
Function Closes a file.
INPUT# Format INPUT# <file number>, <variable> [, <variable> ] ···
Function Reads data from the sequential file, and assigns it to a variable.
LINE INPUT# Format LINE INPUT# <file number>, <character variable>
Function Reads one whole line (record) (max. 255 characters) from the sequential
file.
INPUT$ Format INPUT$ ( <no. of characters> [, [#] <file number> ] )
Function Reads the character string with the specified length from the keyboard or
the file.
PRINT# Format PRINT# <file number>, [USING <format control character string> ; ],
<expression list>
Function Outputs data (numeric value or character string) to the sequential file.
WRITE# Format WRITE# <file number>, <expression list>
Function Outputs data to a sequential file.
FIELD# Format FIELD [#] <file number>, <field width> AS <character variable> ]
[,<field width> AS <character variable> ] ···
Function Allocates the variable area to the random file buffer. (Record definition)
GET# Format GET [#] <file number> [, <numeric value> ]
Function Inputs the data in a file into the buffer.
PUT# Format PUT [#] <file number> ) [, <numeric value> ]
Function Outputs the data to the file.
EOF Format EOF ( <file number> )
Function Checks the end of the sequential file, or whether or not the
communication buffer becomes empty.
LOC Format LOC ( <file number> )
Function Provides the current theoretical location in the file.
LOF Format LOF ( <file number> )
Function Provides the size of the file.