56
User's
Handbook to the Atari 400/ 800 Computers
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. If the
length
of
the strings are unequal, then the shorter string
is
the
lesser. Blank spaces are
counted
and have
an
ASCII value
of
32.
The
following
comparisons
between
strings
would
all evaluate
as
true
.
"ABC"="ABC"
"ABC
">
"ABC"
"aAA"
>
"AAA"
"Alfred"
< "Zachary"
A$ <
Z$
where
A$
"Zachary"
"Alfred"
and
Z$
Note
that all string constants must be enclosed in
quotation
marks
when
used
as
constants.
Logical Operators
Logical
or
Boolean operations are generally used in Atari BASIC
to
compare
the
outcomes
of
two
relational operations. Logical
operations
themselves
return
a
true
or
false value
which
will
be
used
to
determine
program
flow
.
The logical operators are
NOT
(logical
complement),
AND
(conjunction)
, and
OR
(disjunction). These are best explained
with
a simple analogy. Suppose that Steve and Sherry
were
shopping
in
the
produce
department
of
their
grocery
store.
If
they
decided
to
collectively purchase
an
item
if
either
of
them
individually
wanted
that
item
, they
would
be acting
under
the
OR
logical
operator.
Now,
suppose that Steve and Sherry
decided
that
they
would
only
purchase
an
item
if
they
both
wanted that item. They
would
then
be acting
under
the
AND
logical
operation.
Now
, suppose that Sherry
was
angry
with
Steve. If Sherry