EasyManuals Logo

Tandy 1000 Basic Reference Manual

Default Icon
411 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #55 background imageLoading...
Page #55 background image
Chawter
51
Basic
ConceDts
<=
or
=<
Less Than
or
Equal To. The first oper-
and is less than (precedes)
or
is equal
to
the second operand.
>=
or
=>
Greater Than or Equal To. The first
operand is greater than (follows) or is
equal
to
the second operand.
Relational operators are usually used within an IFiTHEN state-
ment.
For
example:
IF
CI
=
1
THEN PRINT "CORRECT"
BASIC looks
at
the value in variable A. If the value is equal to
1,
BASIC prints the word
CORRECT.
If arithmetic and relational operators are combined in the same
expression, BASIC evaluates the arithmetic operations first. For
example
:
IF
X*Y/2
<=
15
PRINT
"4VERAGE
SCORE"
BASIC performs the arithmetic operation
X*Y/2
and then com-
pares the result with 15.
When relational operators are used with strings,
BASIC
compares the strings character by character. When it finds
2
characters that do not match, it checks
to
see which character
has the lower value
ASCII code. The character with the lower
ASCII code comes before the word with the higher ASCII value
in an alphabetical listing, just
as
one word comes before another
in a dictionary.
Consider these examples:
"fl"
<
llgll
BASIC compares the ASCII value
of
the
2
strings. The ASCII
value for
A
is 65, and the ASCII value for B is 66. Since 65 is
less than 66, BASIC returns a
-1.
BASIC displays the result if
you type PRINT and the expression. For example, PRINT
"A">"B".
"CODE"
>
"C
00
L"
This is false. The
first
2
characters
of
the strings match. How-
ever, the third character does not. BASIC then compares the AS-
CII codes. The ASCII code
for
D
is 68 and the code for
0
is
79.
Since
79
is not less than 68, BASIC returns a
0.
"TRAIL"
<
"TRA
I
LER"
53

Table of Contents

Other manuals for Tandy 1000

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Tandy 1000 and is the answer not in the manual?

Tandy 1000 Specifications

General IconGeneral
ProcessorIntel 8088
Processor Speed4.77 MHz
RAM128 KB (expandable to 640 KB)
Operating SystemMS-DOS 2.11
ManufacturerTandy Corporation
Release Year1984
StorageSingle or double 5.25" floppy disk drive (360 KB), optional hard drive
SoundTandy 3-voice sound
PortsParallel, Serial
GraphicsCGA (Color Graphics Adapter)
Graphics Modes320x200, 640x200

Related product manuals