EasyManua.ls Logo

Commodore VIC-20 - Page 52

Commodore VIC-20
308 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...
GET#
Format:
GET#
file#,
variable
Abbreviation:
None
Screen
Display:
None
This
statement
receives
data
one
byte
at
a
time
from
any
OPENed
device.
If
no
data
is
available,
it
works
the
same
as
the
GET
statement,
returning
a
null
value.
The
INPUT#
statement
can
get
more
than
one
character,
and
will
get
all
the
characters
up
to
a
carriage
return
(CHR$(13)).
The
GET#
will
receive
any
characters,
1
at
a
time,
including
special
characters
like
the
carriage
return
and
quote
marks.
EXAMPLE:
tO
OPEN
1,
3
20
PRINT
CHRS{147)
"HELLO
THERE11
CHRS{19);
30
FOR
L
=
1
TO
22
40
GET#1,
BS
:
A$
=
A$
+
BS
50
NEXT
:
PRINT A$
:
CLOSE
1
If
you
examine
A$
when
this
program
is
finished,
you'll
see
that
the
last
character
is
a
CHRSI13),
a
carriage
return,
which
terminates
the
line.
input#
i
Format:
Abbreviation:
Screen
Display:
r
input*
f]ie#,
iK:m:-
In
10
variable
1[,
variable
2, etc.]
This
usually
is
the
fastest
and
easiest
way
to
retrieve
data
that
was
stored
in
a
file
on
tape
or
disk.
The
data
is
in
the
form
of
whole
variables,
as
opposed
to
the
one-byte-at-a-time
method
of
GET#.
First
the
file
must
have
been
OPENed,
then
you
can use
INPUT#
to
fi]|
your
variables.
EXAMPLE:
10
OPEN1,
1,
0,
"TAPE
FILE
NAME"
20
PRINT
'TILE
IS
OPEN
OK'1
30
INPUT#
1,
AS,
B5
40
CLOSE
1
36
[
I