Open - Epson TF-20 Reference Manual

Hx-20 disk basic
Hide thumbs Also See for TF-20:
Table of Contents

Advertisement

NAME
To change the name of a disk file.
NAME <current file descriptor> AS
<new file descriptor
NAME "TEST" AS "TEST 1"
The file specified in <current file descriptor> must exist in
the specified disk and the file specified in <new file
descriptor> must not already exist in the specified disk. If
these conditions are not met, an NE or "File already exists"
error will occur. Also, the device specified in both the current
and the new file descriptor must be the same. NAME
statements should not be executed against files which are
currently open. The results of such an execution cannot be
guaranteed.
4-20

OPEN

To open a file for I/O.
OPEN <mode>, [#] <file No.>, <file descriptor>
OPEN "R", # 1, "B:TEST.DAT"
This statement opens the file specified by <file descriptor>
under the specified <file No.>. The OPEN statement
allocates buffer area for I/O. For disks, a single FCB is
assigned for each file, regardless of mode. Therefore, as
many files as were specified in the FILNUM statement can
be opened simultaneously. <mode> may be "0", "I" or
"R".
0 . . . sequential output mode
I . . . sequential input mode
R . . . random I/O mode
R can only be used for a disk file. When a disk file is opened
in either the 0 or R mode, if the file does not exist on the
specified file, a new file will be created If the file already
exists, that file will be used, in which case the next PRINT#
statement in the 0 mode will output data to the file starting
at its beginning and all the data in the file will be lost.
When a disk file is opened in the I mode, if the specified file
does not exist, an NE error will occur.
More than one OPEN statement, each with a different <file
No.> can be used at the same time in relation to a single file.
However, when output is performed to the file, it cannot be
open under any other <file No.>. The results of outputting to
a single file using multiple file numbers cannot be guararn-
teed.
(See CLOSE and FILNUM.)
4-21

Advertisement

Table of Contents
loading

Table of Contents