Radio Shack TRS-80 PC-3 Owner's Manual page 126

Table of Contents

Advertisement

1 DATA expression list
Where: expression list is:
or:
Abbreviations: DA., OAT.
See also: READ, RESTORE
expression
expression, expression list
Prupose
The DATA verb is used to provide values for use by the READ verb.
Use
When assigning initial values to an array, it is convenient to list the values in 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 state-
ment 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.
OATA statement 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.
126

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents