EasyManua.ls Logo

Commodore VIC-20 - Page 80

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...
EXAMPLES:
2
f
2
results
in
4
12
T
2
results
in
144
I
1
|
3
results
in
1
When
an
expression
has
multiple
operations,
as
in:
A
+
CM0/2T
2
There
is
a
built-in
hierarchy
for
evaluating
the expression.
First,
the
exponentiation
js
considered,
followed
by
the
unary
minus
(-),
followed
by
the
multfplication
and
division
(*/),
followed
then
by
the
addition
and
subtraction
(+
-).
Operators
of
the
same
hierarchy
are
evaluated
from
lett
to
right.
This
natural
order
of
operation
can
be
overridden
by
the
use
of
parentheses.
Any
operation
within
parentheses
is
performed
first.
EXAMPLES:
*2
results
in
6
(4+1)*2
results
in
10
100*4/2-1
results
in
199
100*(4/2-1)
results
in
100
100^(4/(2-1}}
results
in
400
When
parentheses
are
present,
VIC
BASIC
evaluates
the
innermost
set
first,
then
the
next
innermost,
etc.
Parentheses
can
be
nested
to
any
level
and
may
be
used
freely to
clarify
the
order
of
operations
being
performed
in
an
expression.
A
relational
operator
specifies
a
"true"
or
"false"
relationship
between
adjacent
terms.
The
specified
comparison
is
made,
and
then
the
relational
expression
is
replaced
by a
value
of
true
(-1)
or
false
(0),
Relational
operators
are
evaluated
after
all
arithmetic
operations
have
been
performed.
EXAMPLES:
1
=5-4
14>66
15>
=
15
results
results
results
in
in
in
true
false
true
(-D
(0)
(-1)
Relational
operators
can
be used
to
compare
strings.
For
comparison
purposes,
the
letters
of
the
alphabet
have
the
order
A<B, B<C,
C<D,
etc.
Strings
are
compared
by
comparing
their
stored
character
values.
Characters
are
stored
using
a
special
64

Other manuals for Commodore VIC-20

Related product manuals