Directives
DATA Define Data Elements
 
Format DATA expression[$][, ...]
 
Where:
 
expression[$], ... A series of string or numeric expressions.
 
Description Use the DATA directive to define the values for the READ DATA directive. The values to be read can include constants, variables, and/or expressions. You can use a formatted IOList with a READ DATA statement. When ProvideX executes the READ DATA directive, it evaluates each expression in order and places its value into the corresponding variable(s) defined in the READ DATA directive.
 
When ProvideX progresses through reading the data, it increments an internal pointer to the next data expression. When the end of DATA statement is reached, ProvideX proceeds to the next DATA statement in the program. ProvideX returns Error #2: END-OF-FILE on read or File full on write
 
when no further DATA statements exist in the program.


*Note* You cannot use the DATA directive in a compound statement.


 
See Also READ DATA Read Data from Program, RESTORE Reset Program Data Position, BEGIN Reset Files and Variables
LOAD Read Program into Memory
 
Example 00010 DATA 1,"Dog"
00020 DATA 2,"Cat"
00030 DATA 3,"Pig"
00040 READ DATA n,x$,ERR=DONE
00050 PRINT n,x$
00060 GOTO 0040
00070 DONE: PRINT "done"
00080 END
 
RUN
1Dog
2Cat
3Pig done