EasyManua.ls Logo

Commodore Plus 4 - Setting up your Commodore Plus;4

Commodore Plus 4
464 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...
The
Elements
of
BASIC
7
called
Boolean
operators.
Their
role
is
to
check
the
truth
value
of
two
values,
which
may
be
constants,
numeric
variables,
or
calculations.
A
result
of
0
is
false,
and
any
other
value
is
considered
true.
Numeric
values
(operands)
on
either
side
of
a
logical
operator
should
be
integer
numbers,
not
floating-point
numbers,
so
that
they
are
between
-32767
and
32767.
If
you
use
a
floating-point
number,
it
is
converted
to
an
integer
number.
The
result
of
a
logical
operation
is
always
an
integer
value.
You
can
also
use
the
logical
operators
to
AND
or
OR
individual
bits
(binary
digits)
in
two
operands.
You
can
use
NOT
to
invert
individual
bits
in
a
single
operand.
The
following
chart
shows
how
each
of
the
logical
operators
provides
a
result
after
combining
the
truth
values
of
two
values.
A
value
of
-1
is
used
for
a
true
result.
-1AND-1
= -1
-1OR-1=-1
NOT-1=
0
-1
XOR
-1
=
0
-1
AND
0=
0
-1OR
0
= -l
NOT
0
=
-1 -1
XOR
0
=
-l
0AND-l=
0
0OR-l
= -l
0XOR-l=-l
OAND
0=0
0OR
0=
0
0
XOR
0=
0
Logical
AND
AND
requires
both
values
to
be
true
for
the
result
of
the
ANDed
expression
to
be
true.
Any
other
combination
produces
a
false
result.
AND
lets
you
set
compound
comparisons
in
a
conditional
command
such
as
IF
or
WHILE.
When
you
join
a
compound
IF
or
WHILE
command
with
AND,
the
result
of
the
compound
comparison
is
false
if
one
or
both
of
the
conditions
are
false.
For
example
10
INPUT
"AGE,
ANNUAL
INCOME";
X,
Y
20
IF
X=>60
AND
Y<=
10000
THEN
PRINT
"ELIGIBLE":
ELSE
PRINT
"INELIGIBLE"
RUN
AGE,
ANNUAL
INCOME
?
60,15000
INELIGIBLE
RUN
AGE,
ANNUAL
INCOME
?
65,
9900
ELIGIBLE
The
IF
command
in
the
first
execution
is
false
because
only
one IF
condition
is
true
(X
is
greater
than
or
equal
to
60,
but
Y
is
not
less
than
or
equal
to
10000).
Therefore
the
THEN
clause
does
not
execute,
and
the
ELSE
clause
does
execute.
In
the
second
execution
of
the
program,
the
IF
command
is
true
because
both
the
first
AND
the
second
condition
are
true.

Other manuals for Commodore Plus 4

Related product manuals