EasyManua.ls Logo

Commodore VIC-20 - Page 41

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
this
program
runs,
the
question
mark
appears
to
prompt
the
operator
that
the
VtC
is
expecting
an
input
for
line
100.
Any
number
typed
in
goes
into
A,
for
later
use
in
the
program.
If
the
answer
typed
was
not
a
number,
the
?REDO
FROM
START
message
appears,
which
means
that
a
string
was
received
when
a
number
was
expected.
If
the
operator
just
hit
RETURN
without
typing
anything, the
variable's
value
doesn't
change.
Now
the
next
question
mark,
for
line
110,
appears.
If
we
type
only
one
number
and
hit
RETURN,
the
V!C
will
now
display
2
question
marks
(??),
which
means
that
more
input
is
required.
You
can
just
type
as
many
inputs
as
you
need
separated by
commas,
which
prevents
the
double
question
mark
from
appearing.
If
you
type
more
data
than
the
INPUT
statement
requested,
the
?EXTRA
IGNORED
message
appears,
which
means
that
the
extra
items
you
typed
were
not put
into
any
variables.
Line
120
displays
the
word
PROMPT
before the
question
mark
appears.
The
semicolon
is
required
between
the
prompt
and
any
list
of
variables.
Note:
The
only
way
to
end
a
program
during
an
INPUT
statement
is
to
hold
down
the
RUN/STOP
key
and
hit
RESTORE.
EXAMPLE
2:
10
PRINT
"INPUT
A
WORD":INPUT
AS
20
PRINT
-YOUR
INPUT
WAS"AS
30
GOTO
10
LET
Format:
Abbreviation:
Screen
Display:
expression
The
LET
statement
is
used
to
set
a
variable
to
a
value.
The
value
can
be
a
constant
(like
5)
another
variable
(like
C),
or
a
complex
formula
(like
PPR-3).
The
LET
statement
also
works
with
string
variables.
Since
the
LETstatement
is
used
so
often
in
BASIC
programs,
the
word
'LET'
has
been
made
optional,
since
it
did
nothing
but
take
up
memory.
Advanced
programmers
always
leave
it
out.
LET
B=1
This
is
the
same
as
B=1
A
=
3'3-33-B
A
will
equal
41
AS =
"CAT"
-
"DOG"
AS
will
equal
"CATDOG"
25

Other manuals for Commodore VIC-20

Related product manuals