EasyManua.ls Logo

Sharp PC-1500 - Page 70

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
"charact
er
ar
r
ay"
)
you
may also specify the size of the strings, up
to
a
maximum
of
80
characters
per string.
Creat
ing
characte
r'
st
ri
ng$
of
varying
si
ze
s is described
in
Section B
.1
.
To
de
fin
e
an
array, the DIM
{short
fo
r dimensi
on)
statement
i$
\!$ed. Arrays m
uH
a
l
w~ys
be
"decla
r
ed"
{define<!) before
they
arn u
sed.
(
Not
li
ke
the
single·val
ue
variables we l>ave
been
us
ing.)
The
fo
rm for the
numeric
DIMension
statement
is:
DIM
nu
meric·variable·name (size}
\•1he
re:
nu
meric-variable·
na
r
ne
is a va
ri
able
name
vJh
ich
conforms
to
the
normal r
ules
for
numer
ic
variable
names
pr
eviously discussed.
size
is
the
num
b
er
of
storage l
ocat
i
ons
and
must
be
a nt.Jmber in
the
range 0
through
255.
Not
e
that
wh
en
you
specify a n
um
ber
for
the
size
yo
u
get
one
more
locat
ion
than
you
spec
if
i~d.
Examp
l
es
of
legal
nu
meric D
IM
e
ns
ion
sta
te
ments
are
:
DI
M X
15
)
DIM
AA
(24)
DIM
05
(0)
The first
statemen
t cr
eates
an
ar
r
ay
X
with
6 storage locations.
The
second
s.tate
me
nt
creates
an array
AA
\V
i
th
25
locations.
The
t
hi
rd
stater
nent
c1eates
an
array
wit
h
one
lo
catio
n
and
is
actually
raiher
silly since {for n
umb
ers
at
least),
it
is
the
same
as
dec
laring a
sing
l~
·
value
numeric
variable.
It
is
impo
rtant
to
know
that
an
array
-v
ari
ab
le X
and
a vari
ab
le X
are
separat
e
and
distinct
to
SHARP.
The
fi
r
st
X
denotes
a series
of
numeric
storage l
oc
ati
ons,
and
the
se
cond
a single
and
different l
ocat
i
on.
Now
tha
t
you
know
how
to
create
arrays,
you
might
be
wo
n
de
ring
hO\'V
it is
that
we
r
efe
r
to
each
stor1:19e
l
ocat
io
n.
Since
the
entire
group
has
on
ly
one
name
.
the
way
in
which
we
r
efer
to
a single l
ocation
(.called
an
"elerr-ent") is
to
follow
the
group
name
with
a
number
in
pa
r
ent
hese
s.
This
numbe
r is
cal
l
ed
a "sub.scri
pt"
.
Thus,
for exampl
e,
to st
ore
the
number
8
into
the fifth
clement
of
our
array
X (declar
ed
previously)
\VC
would
v1
ritc:
x
(4)
= 8
If the use
of
4 is
p1.1
7.Z
ling, r
emember
tha
t
the
numberi
ng
of
el
ements
beg
in
s
at
ze
ro and
cont
inues
through
the
si
te
number
de
cla
red in
the
DIM
sta
t~mcn
t
.
T
he
real po\\le·r
of
arrays lies in
the
ab
ili
ty
to
use
an
expressi
on
or a variable n
ame
as a
sub·
script.
Fof
example.
to
create a table
containing
the
squares
of
the
numbers
0
to
9 \\'e
could
wr
i
te
the
fo
ll
owing
statements:
10 DIM
SO
(9)
20
FOR I = 0 TO 9
30
SO
(I) =
I*
I
40
NEXT
I
Do
not sale this PDF
!!!
68

Table of Contents

Other manuals for Sharp PC-1500

Related product manuals