EasyManua.ls Logo

Sharp PC-1500 - Page 71

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 PC-1500
at
http://www.PC-1500.info
In
this exal'npfe. the
va
riable I is used
to
select
..
,.,
hi
ch
storage loca
ti
on
\•Jill
hold
the result
and it is also being used
to
compute
the resu
lt.
To dccl
arn
a chJra
cw
r array a s
li
ght
ly
di
fforeirn form of t
he
DIM stat
eme
nt
is u
sed
:
DIM
cha
rac
te
r·v
a
ri
ab
le-
na
rne
(s
iz
e
)*
l
ength
where:
cha
racter ·variable·na
me
is a v
ar
iable name
\.v
hi
ch
con
f
orms
to
the
ru
l
es
f
or
n
orma
l charact
er
var
iable
s
as
discussed pr
ev
i
ous
ly .
~
is the nu
mber
of
storage l
ocat
io
ns and
mus
t be in the ran
ge
0 th
ro
ug
h 2
55
.
No
te
that
when
you
speci
fy
a nu
1nbe
r.
yo
u get one
more
lo
cat
ion
tha
r-.
yo
u specified.
*len
g
th
is
optional
. If used.
it
specifies th e l
ength
of each of the strings that
com
pri
se
the
array.
Le
ngth is a
num
ber
in t
he
r.ange 1
to
80.
If this clause is n
ot
used.
the
st
ring
s,
will
have the
defau
lt
length o f 16 characters.
Examples of leg
al
c
har
acter
array
decla
rati
ons
afe
:
DIM
XS
(
4)
DIM
N
M$
(10) *
10
DIM
I
N$
11)
* 80
DIM
RS
IO)*
26
The
fi
fSt
exa
1n
ple
creates
an
array
of
five
S"t
rin
gs
each
ab
le
to
stofe
16
cha
r
acters
.
The
se
cond
DIM
stateme
nt
de
clar
es
an array NM with ele
ven
str
ings
of
10
ch
ara
cte
rs
each
.
Exp
fici.t
def
ini
tion
of
StfiH
gs
smalle
r
tha
n the
default
he
fJ
)S
to
conse
rve
memory
sp
ace
. The
th
i
rd
example
dec
lares
'a two cl
emen
t arr
ay
of
BO
·ch
afacter
st
rings a
nd
the
last
ex
amp
le decl
ar
es a single
str
ing
of
t\vent
six
cha
r
acters
{se
e
Section
B. I.).
Bes
id
es
the
simpl
e
arrays
\~
.re
have ju
st
st
udied,
t
he
PC·1500 allo
..
vs "t.,,vo·
dimc
nsi
ona
l"
arr
ays
.
By
ana
l
ogy
. a
on
e·di
men
siona
l array is a list of
data
arranged in a single
co
l
umn.
A
two
·d i
mcn·
siona
l
arra
y is
ai
table
of
da
ta
with
ro\vs and
col
u
mns.
The
ty.
•o
·di
mens
i
ona
l
array
is
dec
lar
ed
by
the
st
a
temen
t :
DIM
numcr
ic·
va
ri
.:iblc.namc
(fo1;vs
,
co
lumns)
or
DIM
cha
r
acter·v
.ariable-nar
ne
(rows,
column
s)
*'
l
engt
h
w
he
re:
fOws
specifies
the
n
umbe
r of
rov.rs
in
the
arr
ay.
This
must
be
a n
umbe
r in
the
range O
thfough
255_
Note
t
hat
when
you
speci
fy
t:he
numbe
r
of
ro
ws
you
get
one
more
r
ow
than the
spe
ci
ficati
on
.
co
lun
1n
s
spec
ifies
the
nurnber
of
col
um
ns
in t
he
array.
This m
us
t be a
nu
mbe
r
in
th
e rang
t:
0
t
hro
ugh 2
55
.
Not
e
that
..
vhen
you
specify the
numbef
of
columns
yo
u
get
on
e
mo
re
co
l
umn
than
the
specif
i
cation.
The
follo
w
in9
diagram
ill
ustrates the storage
lo
cat
io
ns that
res
ult
from
the -decla
ration
DI
M T
(2.
3)
and the s
ubscripts
(now
compo
sed of
two
nu
mb
ers) w
hic
h pe
rtain
to
each stor
age
l
ocatio
n :
69
Do
not sale this PDF
!!!

Table of Contents

Other manuals for Sharp PC-1500

Related product manuals