More On Character Strings; Dimensioni Ng Strings; Concatenation - Sharp PC-1500 Instruction Manual

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

Advertisement

All
and
more
about Sharp
PC-1500
at
http://www.PC-1500.info
column
1
column 3
column
4
row
0
T
(0. 01
T
10.
1)
T
(0,
21
T
1
0, 3
)
rO\;\l
T 11.
01
T
11, 1)
T 11,
21
T
I
1. 3
)
T
12. 01
T
(2, 1)
T
(2. 21
T
12. 3)
NOTE: T ... vo·d
imcnsional
arrays can
rapidly
cat
u
p storage
space.
For example, a
n
array with
25
roi.vs and 35
colu
mns
uses
875 storage locations!
Arrays arc very powerful programming
tools.
For a more cornplete treatmerl( of
arr·
a ys, we
recommend
sup ple
men
tary
reading.
B. MORE ON CHARACTER
STRINGS
B.1.
D IMensio ning Strings
Cha
ra
c
ter str'ings
are linlited.
by
default
, to
si xteen ch
aracte
rs
in
length
.
By
dimension ing a
character string it
is
possible to c reate
a
string
\Vhose
length
is up to
80
characters.
Reductions
in string length
,
to conserve
memory
space.
arc a lso possih le.
Th
e length
of
a
strin
g is
specified
in the DIMension
st
atement
as
follows:
DIM variable·narne (bound
)
*
le ngth
whe te:
variablc·namc is the name
of
t
he character string
array,
hound
is
the
ma
ximum
subsc ript
of
the
array,
length
is
th
e
length
of
e
ach
string within the .arr.av.
If
only
one
stri
ng is needed
.
a
n
array
\vi
th
o
ne
element
{subscripted
as
e
lement
zero)
may be
specified
t
o
conserve
memory
space.
This
is illustrated by the follo\•Jing
declaration
of
a 26
chatacter string
;
D IM AS (0)
*
26
B.2.
Cone<1t
enatio
n
Se veral
characte
r
strings (or cha racters w ithin charactcr ·variablcs) can be joined
t
o form a single
string.
TI1is "add ing"
of
ch aracter st
rings is called "concatenation". The
form
fo
r c oncatenati on
is:
variable
=
Example
1:
charactcr·strin9
+
character·string
character·variable
ch
aracte
r
·Variable
10 S$
=
"SUPER"
20 TS
=
S$
+
"
MAN"
30 PR
IN
T
TS
70
Do not
sale
this PDF
!!!

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents