EasyManua.ls Logo

Apple IIe - Page 60

Apple IIe
320 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...
60
Apple
lie
Users
Handbook
of
+1
for
a
true
value.). An
operand
of
a logical
operator
is
evaluated
as
false
if it
is
equal
to
zero.
The result
of
a logical
operation
is
also a
number,
which
if
non-zero
is
considered
true,
and false
if
it
is
zero.
The
following
are examples
of
the
use
of
logical
operators
in
combination
with
relational operators
in
decision making.
IF
X
>10
OR
Y<O THEN
900
IF
A>O
AND
B>O
THEN
200
B=-1 :PRINT
NOT
B
In
the
first
example
,
the
result
of
the
logical
operation
will
be
true
if
variable X
has
a value greater than
10
or
if
variable Y
has
a
value
less
than 0.
Otherwise,
it
will
be false.
If
the
result
of
the
logical
operation
is
true
,
the
program
will
branch
to
line
900.
Otherwise
,
it
will
continue
to
the
next statement.
In the second
example
,
the
result
of
the
logical
operation
will
be
true
only
if
the
value
of
both
variables A and
Bare
greater than
zero.
If
the
result
of
the
logical
operation
is
true
,
program
control
will
branch
to
line
200
.
Otherwise
,
program
control
will
branch
to
the
next
line
.
In
the
third
example
,
Bis
set
to
a value
of-1
(true). The value
of
NOT
B
is
then
printed
. This
will
be 0
or
false.
Illustration
3-3 contains tables that may
prove
of
help
when
evaluating
program
statements
using
logical
operators
in
combination
with
relational operators.

Other manuals for Apple IIe

Related product manuals