EasyManua.ls Logo

Apple IIe - Page 58

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...
58
Apple
lie
Users
Handbook
A
relational
operation
evaluates
to
either
true
or
false. For
example,
if
the
constant
1.0
was
compared
to
the
constant 2.0
to
see
whether
they
were
equal
,
the
expression
would
evaluate'
to
false.
In
Applesoft
BASIC, a
non-zero
value
represents a
condi-
tion
of
true
,
while
a
value
of
0
represents false.
The
only
values
returned
by
a
comparison
in
BASIC
ar~
1
(true)
or
0 (false).
These
values
can
be
used
as
any
other
integer
would
be
used. The
following
results
are generated
by
the
following
relational
expressions.
5
> 7
-o
(false)
3
=
3 - 1 (true)
2
< >
2 - 0 (false)
(2
=
2)
* 4
-4
(1
>
7)+7-7
The first
three
examples
are easy
enough
to
understand.
In
the
fourth
example,
the
relational
expression (2=2)
is
evaluated
first
as
true
or
1. Th
is
resu
It
is
then
multiplied
by
4
with
a
product
of
4
as
the
result.
In
the
fifth
example
,
the
relational
expression
(1
>7)
evaluates
as
false
or
0. This result
is
added
to
7,
with
the
result
being
7.
Relational
operations using
numeric
operations are fairly
straight-
forward
.
However
,
relational
operations
using string
values
may
prove
confusing
to
the
first-
time
computer
user.
Strings are
compared
by
taking
the
ASCII value
for
each
character
in
the
string
one
at a
time
and
comparing
the
codes.
If
the
strings are
of
the
same
length
,
then
the
string
containing
the
first character
with
a
lower
code
number
is
the
lesser. Blank
spaces are
counted
in
string
comparisons and have
the
ASCII
value
of
32
.

Other manuals for Apple IIe

Related product manuals