Data

Data [expression1][,expression2][,expression3]...

Save the result of expressions into memory that can be re-read by Read instruction.
Expressions can be any numeric or string expressions, variables or constants.
This statement must be executed before a data is available for Read instruction.
A pointer to next data is automatically incremented for each data read by Read instruction. 
Such pointer can be reset by Restore.

Example:

Dim s as String
s = "Hello"

Data 2-1, s, .5 

Read a%, b$
Print a%, b$

Restore
Read a%, b$, c
Print a%, b$, c

1     Hello
1     Hello     0.5

Print Restore(0-1) : Rem Release data memory and reset the data pointer to 0

0

Data 2    : Rem Insert 2 in location 0
Read a    : Rem Read 2 and save it into variable a
Print a   

2


Comments