RESTORE
Syntax
RESTORE
Description
Sets the next-data-to-read pointer to the first element of the first DATA statement.
Example
' Create an 2 arrays of integers and a 2 strings to hold the data.
DIM h(4)
DIM h2(4)
' Set up to loop 5 times (for 5 numbers... check the data)
FOR read_data1 = 0 TO 4
' Read in an integer.
READ h(read_data1)
' Display it.
PRINT "Bloc 1, number"; read_data1;" = "; h(read_data1)
NEXT
' Set the data read to the
beginning
RESTORE
' Print it.
PRINT "Bloc 1 string = " + hs
' Spacers.
PRINT
Print
' Set the data read to the beginning
RESTORE
' Set up to loop 5 times (for 5 numbers... check the data)
FOR read_data2 = 0 TO 4
' Read in an integer.
READ h2(read_data2)
' Display it.
PRINT "Bloc 2, number"; read_data2;" = "; h2(read_data2)
NEXT
DATA 3, 234, 4354, 23433, 87643
DATA 546, 7894, 4589, 64657, 34554
Differences from QB
- common to many earlier BASICs
- no equivalent in Visual BASIC
- none from PBASIC