The RESTORE statement

The RESTORE statement
    This statement transfers the pointer, regardless of where it is, to the first value of the data statement in the program.
    Its form is
    The_RESTORE_statement.jpg
    eg :
    28 RESTORE
    Nothing should be specified after the word RESTORE. This statement may be used anywhere in the program.
    Eg :
    10 DATA 25, -10, 3.6
    20 READ J, K
    30 RESTORE
    40 READ M, N, P
    50 END
    assigns the value 25 to J, -10 to K when the READ statement 20 is executed. After this, the RESTORE statement at line 30 transfers the pointer to the start of the data and so the data list can be read from the beginning again. The value 25 is assigned to M, -10 to N, 3.6 to P.

Last modified: Wednesday, 18 January 2012, 11:06 PM