< Futurebasic < Language < Reference
Syntax
RESTORE
Description
This statement is used in conjunction with the DATA and READ statements. It resets an internal pointer which tells FB where to find the next DATA item to read. This allows your program to READ the same DATA item(s) more than once if necessary. If you omit the expr parameter, the DATA pointer is reset to point to the first item in the first DATA statement. If you specify expr, the DATA pointer is reset to point to the item immediately following the expr-th item. Thus RESTORE 1 points to the second item; RESTORE 2 points to the third item; and so on.
Example: DATA Able, Baker DATA Kane, Dread DATA Echo FOR i = 1 to 5
READ x$ PRINT x$,
NEXT PRINT RESTORE 3 READ x$, y$ PRINT x$, y$ program output: AbleBaker KaneDreaEcho Dread Echo
See Also
READ; DATA
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.