EasyManua.ls Logo

Commodore VIC-20 - Data

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...
by
pushing
together,
or
concatenating,
two
separate
strings
to
form
one
longer
string.
We
will
describe
this
further
when
we
discuss
i
string
variables
in
general.
Earlier
in
the
chapter,
we
introduced
the
concept
of
a
variable.
In
this
discussion
variables
are
described
more
thoroughly.
Available
is
a
data
item
whose
value
may
be
changed.
The
value
is
determined
by
the
number
assigned
to
the
variable.
If
you
type
the
immediate
mode
statement:
PRINT
10,
20,
30
10
20 30
The
VIC
will
display
the
same
three
numbers
(as
illustrated
above)
whenever
the
PRINT
statement
is
executed;
that
is
because
this
PRINT
statement
used
constant
data.
However,
you
can
write
the
immediate
mode
statement:
A=10:
B =
20:
C
=
3Q:
PRINT
A,
B,
C
10 20
30
The
same
three
numbers,
10,
20T
30p
are
displayed;
however.
A,
j
B,
and
C
are
variables, not
constants.
By
changing
the
values
assigned
to
A, B,
and
C,
you
can
change
the
values
printed
out
by
the
PRINT
statement.
Consider
the
following
example
of
this:
A-
-4:
B-45;
C-4E2:
PRINT
AT
B,
C
-4
45
400
You
will
notice
that
variables
appear
in
virtually
all
computer
programs.
Variables
are
identified
by
names.
We
used
A,
B,
and
C
as
variable
names
in
the
illustrations
above.
A
variable
has two
parts:
its
name
and
a
value.
The
variable
name
represents
a
location
at
which
the
current
value
is
stored.
In
the
following
illustration,
the
current
value
of
A
is
14;
for
B
it
is
15;
and
for
C
it
is
0.
Variable
Name
Contents
A
14
B
15
C
0
If
we
change
A
to
-1
using the
immediate
mode
statement:
A=-1
then
the Location
Contents,
stored
under
the
variable-name
AT
will
change
from 14
to
-1.
This
is
an
excellent
way
of
looking
at
variables
because
it
is,
in
5a

Other manuals for Commodore VIC-20

Related product manuals