Avisaro Online Documentation - Wiki
Impressum Kontakt Sitemap

DATA - READ - RESTORE

Description

DATA can be used to store numeric and string constants that can be fetched with the READ command.

READ gets those constants one-by-one and puts them into variables. Then, the internal read pointer is advanced. After reading the last item, subsequent READs will always read 0 until the internal read pointer is reset with RESTORE.

After RESTORE, the next READ command will read the first item. There are more than one DATA statement possible. Multiple DATA statements work like a single, big one. That is, all items are concatenated.

Example

OUTMODE -2 
READ a,b,c$,d,e,f,g
PRINT a
PRINT b
PRINT c$
PRINT d
PRINT e
PRINT f
PRINT g
RESTORE
READ b
PRINT b
DATA 10,20,"just a string",30,40

The READ statement fills 7 Variables from 5 stored items. The first 5 variables are assigned to the items found in the DATA line in the same order.
Next two variables (f and g) become 0, because there are no more items in the list. After RESTORE executes, the following READ statement reads the first DATA item again.

Remarks

See also: MEMCFG (Mehr more) command to resize memory areas.

 

Attention:

Due to a bug in the scripting engine, DATA-READ-RESTORE is not fully functional before firmware version 3.24. The module might crash if a program reads more items than the sum of all DATA statement contains. This problem does not exist in version 3.24 and above.