EasyManua.ls Logo

Apple IIe - Page 83

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...
Apple
BASIC
Reference
Guide
83
AND
would
treat
it
as
true.
The
following
is
the
truth
table
for
AND
.
x
y
XANDY
true
true
true
true
false
false
false
true
false
false false false
In
both
Applesoft
and
Integer
BASIC,
a
true
is
represented
by a 1
and
false
by a
0.
10
A=
2
20
B
=3
Example 1
30
IF
(A=
2)
AND
(B
=
3)
THEN
60
40
PRINT"
AND
FAILED
LOGICAL
TEST"
50
GOTO
70
60
PRINT
"AND
PASSED
LOGICAL
TEST"
70
END
]RUN
[Ret]
AND
PASSED
LOGICAL
TEST
In
the
preceding
example
,
line
30
first tested
the
value
of
A. Since
A was set
equal
to
2
in
line
10,
the
first
expression
was
evaluated
as
true.
The
value
of
B was
then
tested.
It
too
evaluated
as
true
.
Using
the
logical
AND
table,
if
expression1
and
expression2
evaluated
to
true,
then
the
whole
AND
expression
evaluated
as
true
. The
program
will
then
execute
the
THEN
portion
of
the
statement and
will
branch
to
line
60
.
At
line
60
,
the
message
AND
PASSED
LOGICAL
TEST
was
displayed.
Example
2
PRINT
(3=1+2)
AND
(-
5)
1
In
this
example
,
3
is
set
equal
to
1 + 2,
so
the
first
expression

Other manuals for Apple IIe

Related product manuals