Download Print this page

File Handling - Commodore C2N Operating Instructions Manual

Cassette unit suitable for use with vic, pet & cbm series computers
Hide thumbs Also See for C2N:

Advertisement

FILE HANDLING

Experienced programmers may write more sophisticated programs
that use large amounts of data. This data may be stored o a file on the
cassette. The commands to handle data files are explained below.
Files of data can be written to and read from the cassette unit.
These CANNOT be LOADed like a program, but can be read from by a
program. To communi c ate with the cassette unit, we use the OPEN
command:
OPEN A,B,C,"NAME"
This will OPEN a logical file where NAME identifies the file and:
A
is a reference integer from 1 to 255 chosen by the user. If a
program uses more than one file, each file must be a unique
reference integer.
B
must be 1 for the cassette.
C
specifies whether the program will WRITE to or READ from this
file, coded as follows:
if C=0 read from tape
C=1 write to tape with an End-Of-File marker to be written when the
file is CLOSED.
C=2 write to tape with an End-Of-Tape marker to be written when the
file is CLOSED.
Example: OPEN5,1,1,"TEST"
will OPEN a file named "TEST" and having a reference integer of 5. The
program will WRITE to this file on the cassette.

Advertisement

loading