EasyManua.ls Logo

Commodore VIC-20 - Page 285

Commodore VIC-20
404 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 8 Peripheral Devices 271
"B-R:"
is
the abbreviation for "BLOCK-READ:". The colon within the
quotation marks positions the data that follow the instruction
4
is
the secondary address from line
20
above
o
is
the drive number. This
is
mandatory when you are using the
direct access instructions
A
is
the track number that
was
input in line
30.
Although you may
use variables to designate track and sector in these instructions, a
constant can
be
used as
well
B
is
the sector number.
All
of
the
data-secondary
address, drive number, track number, and
sector
number-in
this instruction must be separated by semicolons, as
shown in the example.
N ow
that
the
data
in your selected block has been transferred to the
buffer, you will need to use a GET# or an INPUT# statement to extract it
from the buffer.
The INPUT# statement retrieves all bytes up to and including the first
carriage return it finds. Since you may not know the exact
data
in a sector
before you read it, you may overrun the length
of
the INPUT#, which can
hold only
80
bytes.
Because
of
this limitation
of
the INPUT# statement, it
is
preferable to
use the GET# statement when you are unsure
of
the data you will read.
It
will
read the data one byte at a time.
613
OET#2,
A$
There are
256
bytes
of
data
in each block,
but
not every block
is
full.
To
read all the
data
in a block
and
stop
at
the end
of
the file, test the status
variable (ST) to see if it
is
zero.
70
IF
ST=0
THEN
PRINT
Af;:OOTO
60
Note: Although there
is
a trailing semicolon in the
PRINT
statement,
the display will
jump
to the next line whenever it reaches a carriage return in
the data, separating the data just as they were entered.
If ST
=
0,
there are still more data, and you can go back and get another
byte. Otherwise, close all channels when you are done with them.
80
CLOSE2:
CLOSE15

Other manuals for Commodore VIC-20

Related product manuals