Download Print this page

Commodore 1531 Datassette User Manual page 17

Advertisement

C and NAME may be left out if the user wishes. If NAME is not used, the file
will be OPENed without a name. When a READ instruction is given by the
computer, it will read the first file that it finds. If C is left out, then the file will
be OPENed for READ.
INPUT #A,D
will input data from the cassette and use it in the program.
A
is the logical file number used in a previous OPEN statement which
specifies READ from cassette.
D
is the BASIC variable to which the data from the tape will be
transmitted. If words are to be read, then D should be D$. The error
message FILE DATA ERROR will be displayed if you don't use D$.
Example; IN PUT # 5 , A$
will input string data (words) from logical file 5. Data will be read from
the cassette and assigned to the variable A$.
GET # is an alternative to INPUT # . GET # will get one character
(letter) at a time. GET # can read commas, colons, etc., whereas
INPUT # cannot.
PRINT #A,D
will write data to the cassette where
A
is the logical file number used in the previous OPEN statement which
specified WRITE to the cassette.
D
is the BASIC variable from which the data is to be written. If the data
is words, then D$ must be used.
Example: PRINT # 5 , A$
will output the string A$ to logical file 5 on the tape provided the file
has been OPENed for write. If the file was not properly OPENed, NOT
OUTPUT FILE will be displayed.
CLOSE A
will close the file designated A, where A refers to the file number.
WARNING: If this command is not used after all the data has .been written to
the cassette, some data may not be written to the cassette.
1 5

Advertisement

loading