EasyManua.ls Logo

Commodore VIC-20 - I Operators

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...
OPERATORS
I
An
operator
is
a
special
symbol
that
VIC
BASIC
recognizes
as
representing
an
operation
to
be
performed
on
the variables
or
constant
data.
One
or
more
operators,
combined
with
one
or
more
terms,
form
an
"expression."
VIC
BASIC
provides
arithmetic
operators,
relational
operators,
and
Boolean
operators.
An
arithmetic
operator
defines
an
arithmetic
operation
to
be
performed
on
the
adjoining
terms.
Arithmetic
operations
are
performed
using
floating
point
numbers.
Integers
are
converted
to
floating
point
numbers
before
an
arithmetic
operation
is
performed;
the
result
is
converted
back
to
an
integer.
Consider
the
following
operations
and
their
symbols:
a.
Addition
(+).
The
plus sign
specifies
that
the
term
on
the
left
is
to
be
added
to
the
term
on
the
right.
For
numeric
quantities
this
is
straightforward
addition.
Examples:
2
+
2
A+B
+
C
X%+1
BR+10E-2
The
plus sign
can
be
used
to
add
strings;
but
rather
than
adding
their
values,
they
are
joined
together,
or
concatenated,
forming
one
longer
string.
The
difference
between
numeric
addition
and
string
concatenation
can
be
visualized
as
follows:
Addition
numbers:
num1
+num2
=
num3
Addition
of
strings:
I
I
stringi
+
string2
=
string!string2
By
concatenation,
strings
containing
up
to
255
characters
can
be
developed.
EXAMPLES:
"FOR"
+
"WARD"
results
in
"FORWARD"
"HI"
+
"THERE"
results
in
"HITHERE"
A$+B$
results
in
ASBS
b.
Subtraction
(-).
The
minus
sign
specifies
that
the
term
to
the
right
of
the
minus
sign
is
to
be
subtracted
from
the
term
to
the
left.
62
I

Other manuals for Commodore VIC-20

Related product manuals