EasyManua.ls Logo

Radio Shack TRS-80 Model III - Page 152

Radio Shack TRS-80 Model III
274 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...
TRS-80
MODEL
III
DATA item
list
Lets you store
data inside
your program to
be accessed by
READ statements.
The
data items
will be read
sequentially,
starting with the first
item in the
first DATA
statement, and ending
with the
last item in the last
DATA statement.
Items in
a DATA
list may
be string or numeric
constants
no expressions
are allowed.
If your string
values include
colons, commas
or leading blanks,
you must enclose
these
values in
quotes.
It is important
that the data
types in a DATA
statement match
up with the variable
types in
the corresponding
READ statement.
DATA statements
may appear
anywhere
it is convenient
in a program.
Generally,
they are placed
consecutively,
but this is
not required.
Examples:
10 READ
Nl*.
N2*» N3* N4
20 DATA THIS
IS
ITEM ONE.
THIS
IS ITEM TWO*
3> 4
30 PRINT
N3.* 9 N2*.
N3»
N4
See READ, RESTORE.
READ
item list
Instructs
the Computer
to read
a value from
a DATA
statement and
assign that
value
to the
specified variable.
The
first time
a READ is executed,
the first
value in the
first
DATA
statement
will be used;
the second
time, the second
value in
the DATA
statement will
be read. When
all the items
in the first
DATA statement
have
been
read,
the next
READ will
use the first
value in the
second DATA
statement;
etc. (An
Out-of-Data
error occurs
if there are
more attempts
to READ than
there are
DATA
items.)
The following
program illustrates
a common
application
for
READ/DATA
statements.
142

Other manuals for Radio Shack TRS-80 Model III

Related product manuals