Logical Expressions - Sharp PC-1403 Operation Manual

Hide thumbs Also See for PC-1403:
Table of Contents

Advertisement

87
of
B
Note: Value of A and B
must be 0
(false)
or 1
(true}.
True
False
True
False
True
False
True
False
Value
Value of A
AXOR B
of B
True
False
True
True
True
False
True
False
Value
True
False
True
True
False
False
False
False
Value
of B
Value of A
AOR B
Value of A
AAND
B
Relational
expressions evaluate to eitherTrue
or
False.
The computer represents True
by a 1; False is represented
by
a
0. In
any
logical
test,
an expression which evaluates
to
1
or more will be
regarded as
True, whereas
one which
evaluates
to
O or less will be
considered
False.
Good programming practice,
however,
di
c tates the use of
an
explicit
relational
expression instead of
relying on
this
coinci
d
ence.
Logical Expressions
Logical expressions
are
relational
expressions which use operators AND,
OR,
XOR, and
NOT. AND,
OR,
and XOR are
used
to connect two
relational expres-
sions; the values
of
the
combined expressions
are as
shown in
the
following
tables.
"ABCOEF"
=
"ABCDEF"
"ABCOEF"
<>
"ABCDE"
"ABCDEF"
>
"ABCDE"
A<B
C(1,2)>;:
5
0(3)<>8
If A was
equal
to
1
O,
B
equal
to
12, C(1,2)
equal to
6, and
0(3)
equal
to 9, all of
these relational
expressions
would be
True.
Chapter
strings can
also be
compared in relational expressions. The two
strings are
compared character by
character according to their
ASCII value
starting at the first
character
(see
Appendix B for
ASCII
values).
If one string
is
shorter than
the other,
a
o
or
NUL
will
be
used
for
any
missing
positions.
All
of
the following relational
expressions are
True:
The following are valid
relational
expressions:
Concepts
and Terms of BASIC

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents