EasyManuals Logo

IBM 5100 Basic Reference Manual

IBM 5100
187 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 #59 background image
(
(
(
Relational Expressions
A relational expression compares
the
value of
two
arithmetic expressions or
two
character expressions. The expressions
to
be compared are evaluated and
then
compared according
to
the
definition of
the
relational
operator
specified. According
to
the
result,
the
relational expression
is
either satisfied (true)
or
not
satisfied (false).
Relational expressions can appear in a BASIC program
only
as
part
of
an
IF
state-
ment.
The relational operators and their definitions are:
Operator Meaning
Equal
=1=
or
< >
Not equal
;:;:or>=
Greater than
or
equal
$or<=
Less
than
or
equal
>
Greater than
<
Less
than
Note: The system stores < >
as
=1=,
< =
as
$,
and>
=
as;:;:.
Comparison uses
all
13
digits.
The general format of a relational expression
is:
el
relational·operator
e2
where
el
and
e2
are any expressions
other
than
array or relational expressions, and
relational-operator
is
any
of
the operators just described. Both
el
and
e2
must be
of
the
same data
type
(character
or
arithmetic), and only
two
expressions can be com-
pared
in
a single relational expression.
When character
data
appears
in
a relational expression, it
is
evaluated according
to
the
collating sequence (see Appendix
A)
character by character, from left
to
right.
Thus,
the
following relational expressions would
all
be satisfied:
'ABC' = 'ABC'
'ABLE' < 'BALL'
'123' > 'BALL'
'$12'
<
'7'
When character operands
of
different lengths are compared,
the
shorter operand
is
considered
to
be
extended
on
the
right with blanks
to
the
length of
the
longer op-
erand. Thus,
in
the
preceding third example, values compared are
12316
and BALL,
where
16
is
a blank character.
55

Table of Contents

Other manuals for IBM 5100

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM 5100 and is the answer not in the manual?

IBM 5100 Specifications

General IconGeneral
Release Year1975
RAM16 KB - 64 KB
Storage204 KB tape drive
Display5-inch CRT
Operating SystemAPL/BASIC
ProcessorIBM PALM (1.9 MHz)

Related product manuals