ii.
100
DIM
month$(12,9)
110
RESTORE
120 REMark Data
statement
exampLe
130
FOR
count=
1
TO
12 :
READ
month$(count)
140 PRINT month$
150
DATA
"Januaryll,"February","March"
160
DATA
"Apri
l","MaY","June"
170
DATA
"JuLy","August","S
ep
tember"
180
DATA
"October",
"November",
"0ecemberll
An
implicit RESTORE
is
not performed before running a program.
This
allows
a single
warning
program
to
run
with
different
sets
of
data.
Either include a RESTORE
in
the
program
or perform
an
expliCit
RES10RE or CLEAR before running
the
program
DATA
READ
RESTORE
BASIC
FOR
SERVICE
MANUALS
CONTACT:
MAURITRON
TECHNICAL
SERVICES
www.maurilron.co.uk
TEL: 01844 - 351694
FAX: 01844 - 352554
allows
data
to
be
defined within a program. The data
can
be read
by
a READ statement and
the
data assigned
to
variables. A
DATA
statement
is
Ignored by SuperBASIC when
it
IS
encountered dUring normal
processing.
syntax:
DATA
*[expression,] *
reads
data contained
in
DATA
statements
and assigns
it
to
a
list
of
variables.
Initially the data pointer
is
set
to
the
first
DATA
statement
in
the
program
and
is
incremented
aher
each READ. Re-running
the
program
will
not
reset
the data pointer and
so
in
general a program should contain an
explicit
RESIDRE
An
error
IS
reported
If
a READ
is
attempted
for
which there
is
no
DATA.
syntax:
READ *
[Identifier,]
*
restores the data
pointer,
i.e.
the position
from
which subsequent READs
will
read
their data.
If
RES10RE
is
followed
by
a line number
then
the
data pointer
IS
set
to
that
line.
If
no parameter
is
specified
then
the data
pointer
is
reset
to
the
start
of
the
program.
syntax: RESIDRE
[line_number]
example: 100 REMark
Data
statement
exampLe
110
DIM
weekdays$(7,4)
120
RESTORE
130
FOR
count=
1
TO
7 :
READ
weekdays$(count)
140 PRINT weekday$
150
DATA
"MON'I,"TUE
II
,"WED","THUR","FRI"
160
DATA
IISAT"
t "SUN"
READ,
DATA
and RESTORE allow embedded data, contained
in
a SuperBASIC
program,
to
be
assigned
to
variables
at
run
time.
DATA
is
used
to
mark and define
the
data, READ accesses the data and assigns
it
to
variables and RES10RE
allows
specific
data'
to
be selected.
DATA
READ
RESIDRE:
•
•
•
12/84
13