EasyManua.ls Logo

Commodore VIC-20 - CHAPTER 2 Operating the VIC 20; IMMEDIATE MODE

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...
When
using
the
screen
(device
#
3)
as
an
input
device,
the
INPUT#
statement
can
be
used
to
read
any
whole
line
of
text
from
the
screen.
The
last
character
of
the
line
will
be
read
as
a
CHR$(13),
as
if
the
screen
hit
the
RETURN
key
at
the
end
of
the
line!
However,
there
are
times
when
it's
not
aiways
practical
to
use
1NPUT#,
and
some
precautions
are
in
order.
If
a
siring
variable
put
on
the
file
has
certain
characters,
using
INPUT#
could
have
unexpected
results.
If
you use
CHRS(13),
or
a
comma
(,)
or
semicolon
{;)
or
colon
{:),
the
VJC
will
think
that
this
marks
the
end
of
your
variable.
If
you
put
quote
marks
(CHRS(34))
at
the
start
and
end
of
your
string
when
it
is
written,
it
will
come
back
intact.
IN
PUT #
may
also
be used
to
'llNPUT"
data
without
the
question
mark
(?)
prompt
being
displayed.
This
is
very
useful
for
a
variety
of
applications,
for
example
if
you
want
to
set
up
a
graphic
chart
and
let
the
operator
INPUT
data
to
the
chart
without
question
marks
being
displayed.
EXAMPLE:
10
OPEN
1,0
20
PRINT
"ENTER
A
NUMBER'1:
INPUT#1,
A
30
PRINT
A
"TIMES"
5
"EQUALS'1
A*5
OPEN
Format:
Abbreviation:
Screen
Display:
OPEN
file#,
oftTfr-Tlp
O
lII
[device#T
command^
string]
This
statement
OPENs
a
channel
for
input
and/or
output
to
a
device.
This
device
can
be
part
of
the
VIC,
like
the
screen
and
keyboard,
or
an
accessory,
like
the
tape
recorder,
printer,
or
disk
drive.
When
OPENing
a
channel
to
an
externaE
device,
the
VIC
sets
up
a
buffer
for
the
data,
and
only
transmits
and
receives
whofe
buffers
at
a
time.
The
file#
can be
any
number
from
1
to
255,
and
is
the
same
number
that
will
be used
in
the
INPUT#,
GET#,
and
PRINT*
statements
to
work
with
this
device.
The
device#
specifies
which
device,
and
is
set
within
that
device.
37