EasyManua.ls Logo

Sharp PC-1500 - Advanced Programming; Arrays and Subscripted Vari Ables; DIM

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...
All and more about Sharp PC-1500 at http:f/www.PC-1500.info
Example 3:
INT 31 .
62
+
21.18
l<
tu
l
52.
18
The
com
puter
takes
that
INT of
th
e
fi
rst
number
31.
62
(result:
31)
a
nd
add
s th
at
to
21.18
10
9c1
52.18. This is s
li
ghtly diflorent
fr
om t
he
fi
r
st
computat
ion, eh?
S
GN
For
a
ny
number X
th
e
SG
N
fu
nction
re
tu
rns a value indi
ca
ting if the n
urn
ber
is
neg\'ltive. zero,
or
positive.
The
values
are
the follo\"ling:
i I x > 0
0
ii
x = 0
- 1
ii
X < O
Exa
rnpl
e
s:
5 - 10
(
i!
NtER!
-s
'
J
SGN (5 -
10)
[l:
NT
£il
)
12 - 4
[EHTii)
s]
SGN
(12 -
4)
!
LNTElll
f
15 -
15
!
FNTFA
I
0]
SGN
{1
5 -
151
@~
11
)
01
V. ADVANCED PROGRAMMING
A. A
RRAYS
and
the
DI
M
St
atement
Most
of
our sample programs
to
date have
u-sed
a small number
of
variablC:$.
As
you
beg
in
to
utilize
the
full processing potential
of
the PC-1500
you
will discover
that
variables whi
ch
hold
a
single
number
can h
ave
drawbac
ks.
Perhaps, for example.
you
are
co
nsidering a program
which reads in
fifty
num
bers and sorts them. You may quickly
conc
l
ud
e t
hat,
although the
PC
· 1500
ha
s m
ore
tha
n enough
po
tential
va
r
iab
les,
th
ere
must
be an easier way. There
is
. and
it
is
ca
ll
ed
an "array
var
i
ab
le".
An arr
ay
is simply a group of con
se
cuti
ve
stor
age
areas.
or "lo
ca
tions",
i.•1ith
a
si
1iglc name .
Ea
ch
sto
ra
ge
ar
ea
con
hold a s
ingle
numbe
r or
l?'ach
s
torag
e
area
can
ho
ld
a
ch
ci
r
.a
c
ter
s
tring
. All of
the storage are
as
wi
thin a given array
must
ho
ld
th
e same type
of
data.
T
he
number
of
locations within a single array
may
be
as
mat1y as 2
56
and
is
dtttermined
by
your specification. Thus, if you define a numeric array with
50
location
s.
this allows
you
to st
or
e
up
to
50
numbers in association with a single name.
If
you
de
fine an
arra
y
of
st
ri
ngs (called a
67
Do
not sale this PDF!!!

Table of Contents

Other manuals for Sharp PC-1500

Related product manuals