Login
Plus/4 EncyclopediaFirstBackNextLast

RESTORE Statement
Category
Reference/Commodore BASIC V3.5

Topic
RESTORE [line#]

When executed, the RESTORE statement resets the pointer to the next DATA statement in a program, allowing READ statements to re-read DATA statements.

If a line number follows RESTORE, the pointer is set to that line. If there is no number, the pointer is reset to the start of the program. If the specified line number does not exist, an ?UNDEF'D STATEMENT ERROR occurs. If a negative number or a number greater than 65535 is used, an ?ILLEGAL QUANTITY ERROR occurs. If a string in double quotes is used, a ?TYPE MISMATCH ERROR occurs.

The line number can also be specified with a variable or arithmetic expression. If a fraction is returned, the fraction component is ignored. If a string variable is used, a ?TYPE MISMATCH ERROR occurs.

Examples
RESTORE 200 Resets pointer to line 200
B=200:RESTORE B As above, but using a variable
C=150:RESTORE C+50 As above, but using variables + arithmetic

Abbreviation
RE SHIFT+S



Copyright © Plus/4 World Team, 2001-2024. Support Plus/4 World on Patreon