Sharp PC-1403 Operation Manual page 143

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

Advertisement

137
Loads
the
values
from
the
DATA.
statement into
8(
). 8(1)
will
be 10, 8(2) will
be
20,
8(3)
will
be 30,
etc.
Sets up
an array.
10 DIM
8(10)
20WAIT128
30 FOR 1=1
TO 10
40 READ
B{I)
50 PRINT
8(1)
60 NEXT I
70
DATA
10,20,30,40,50,60
80 DATA
70,80,90,100
90
END
Examples
l!J41
When
assigning initial values
to an
array,
it is convenient
to
list
the values i
n
a DATA
statement
and
use
a READ
statement in
a FOR ...
NEXT
loop to
load
the values into
the
array.
When the first READ is
executed,
the
first
value
in
the first DATA statement is
returned.
Succeeding
READs use succeeding values in
the
sequential
order in which
they
appear
in
the
program, regardless
of
how many
values are listed
in each DATA
statement or how
many
DATA statements are
used.
DATA
statements have no effect
if
encountered
in
the course
of
regular
execution of the
program,
so
they can be inserted
wherever it
seems appropriate. Many
programmers
like to include them
immediately
following
the
READ which uses
them. If desired, the
values in a DATA
statement
can
be
read a second
time
by using
the RESTORE
statement.
1µ11;.i-tiM
The DATA verb
is
used
to
provide
values
for
use by the
READ
verb.
Abbreviations: DA., DAT.
See also: READ,
RESTORE
1 DATA
expression
list
Where:
expression
list is:
expression
or:
expression,
expression
list
Verbs
DATA

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents