ZX BASIC:RESTORE

From BorielWiki
Jump to: navigation, search

Contents

RESTORE

Syntax

RESTORE [<label>] 


RESTORE statement is used to change the order in which DATA lines are read. The RESTORE label statement will make the next READ to get the data from the label line onwards. If no label is specified, the data reading sequence is restarted from the beginning.


Example

RESTORE numbers
 
FOR i = 1 TO 3
    READ a
    PRINT a
NEXT i
 
strings:  
REM These will be skipped by the RESTORE above
DATA "Hello world!", "ZX Spectrum", "ZX Rules!"
 
numbers:
DATA 10, 20, 30

This will output:

10
20
30

Notice the strings section has been skipped over.

Remarks

  • This statement is Sinclair BASIC compatible.

See also

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox
Translate
Google AdSense