EasyManua.ls Logo

Radio Shack TRS-80 Model III - Page 128

Radio Shack TRS-80 Model III
274 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...
TRS-80
MODEL III
The ASCII code
for
O
is
79;
for
D
it's
68.
If while making
the comparison,
BASIC reaches the end
of one string before
finding
non-matching characters,
the shorter string is
the precedent. For
example:
"TRAIL"
<
"TRAILER"
Leading and
trailing blanks
are significant. For
example:
"
A"
< "A"
ASCII for the space
character is
32;
for A, it's
65.
"Z-80"<"Z-80A"
The string on the left
is four characters
long; the string on the right is five.
How
to Use Relational
Expressions
Normally,
relational expressions are
used as the test in an IF/THEN
statement.
For
example:
IF
A
=
1 THEN PRINT
"CORRECT-
BASIC tests
to
see if A is
equal to 1. If it is, BASIC prints
the message.
IF
A$
<
B$ THEN 50
If string
AS alphabetically precedes string
B$, then the program
branches
to
line
50.
IF R$
=
"YES" THEN PRINT
A$
If
R$ equals YES then the message stored
as A$ is printed.
However,
you may also
use relational expressions simply
to return the
true or
false
results of a test. For
example:
PRINT
7=7
Prints
1 since the
relation tested is true.
PRINT
"A" > "B"
Prints because the
relation tested is
false.
118

Other manuals for Radio Shack TRS-80 Model III

Related product manuals