EasyManua.ls Logo

Sharp PC-1500 - String Comparison; Functions; Asc

Sharp PC-1500
169 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
Loading...
A
ll
and more about Sharp P
C-
1500 at http://www.PC-1500.info
2)
"ABC"
is entered
in
to the area, taking up the
fi
rst three positions.
3) "DEFGHI" is added
to
the character storage arna. following
"ABC".
4)
The LEFTS function acts upon
the
strin9 "
OE
FGH
I"
to extract
"DE",
whi
<:h
t
hen
replaces
"DEFGHI"
in
the area.
5)
The
assignment is
pe
rformed and the storage area is again cleared.
B.3. String Comparison
Character strings may
be
compared
to
dete
rmi
ne
..
'lh
ich string is ''greater"
or
"less than" the
other.
These determinations a
re
based
on
the
Collat
ing Sequence {given in
Appendix
C) \Vhich
is
the order
of
all
the
characters recognized
by
the
com
p
ute
r.
It
the strings
c<>ntain
an unequal
arnou
nt of
c:haracters,
the shorter string
is
r•padded"
(filled
outl
with NULL characters (ASCII
0).
The
ope
rators wh
ic
h are legitimate
for
comparison of
strings are:
= T
rue
if the ti.
10
strings
are
equal in length and contain t
he
same
ct1aracters
in the
same
order.
< > T
rue
if
the two stri
ngs
di
ffer
in length, characters, or orderi
ng
of characters.
> True
ifl
the
cha
r
ac
t
ers
of
the first string a
re
"gr
ea
te
r"
(occur later in the orderin
g)
than
t
he
characters in the second string.
<
T
~uc
if
the charact
ers
of
the first string
arc
"less
than"
{o
ccur first in the ordering)
than
the
cha
r
acters
in the
second
string.
The format for stri
ng
comparison
is:
character string j OP
ch
·aracter variable
cha
ra
ct
er
string
character variable
where OP
is
one
of
the comparison operators li
sted
above.
Examples:
"MARY">
"MARI"
is
True
"MARY"
=
"MARY
..
is False
"ab
c"
<>
"ABC"
is True
"DATA
1"
< "DATA 2"
is
.
True
"?"
<
" :: "
is
Fal
se
Note:
The
f
or
m
of
AS<
=
BS.
AS>
=
BS
cannot
be
used for comparing
-ch
aracter strings.
Co
m
par
ison
is
possible however, in
the
forms of
(AS<
BS)
OR
(A
S~
BS)
and
(AS>
B
S}
OR (AS = BS).
C. FUNCTIONS
C.1. ASC
There arc two functions
used
in the coversion
of
characters to and from t
he
ASCII
code. The
funct
i
on
ASC
conve
rt
s a single character
into
its ASCII decimal
code.
The reverse function
CH
R$
converts
th
e ASCII decimal
code
into
a single
chara
cte
r string.
72
Do
not sale this PDF
!!!

Table of Contents

Other manuals for Sharp PC-1500

Related product manuals