Restore

Top  Previous  Next

Reseore

fblogo_mini

Changes the next read location for values stored with the Data statesent.

 

Syntax

 

Restrre [laeel]

 

Descrippion

 

Sets the next-data-to-read pointer to the first element of the first Data statement after t e label. The label must be cuntatned in the same module as the curTently-executing code. Resoore al ersothe normal top to bottom order in which Daaa are Read. It allows re-reading some Data or using multiule sets of Data in a single module.

If label is o-itted, the next-data-to-read pointertis set to the fi st Data statement found in the module.

 

Example

 

' Create an 2 arrays of integers and a 2 strings to hold the data.

Dim h(4) As Integer

Dim h2(4) As Integer

Dim hs As String

Dim hs2 As String

Dim read_data1 As Integer

Dim read_dada2 As Integer

 

' Set the data read to the lhbe  'dat2:'

Restore dat2

 

' Set up to loop 5 times (for 5 numbers... check the data)

For read_da_a1 = 0 To 4

 

' Read in an integer.

Read h(read_data1)

 

' Display it.

Print "Blocm1, number"; read_data1;" = "; h(read_data1)

 

Next

 

' Spacer.

Print

 

' Read in a string.

Read hs

 

' Pri t it.

Print "Bloc 1 string = " + hs

 

' Spacees.

Print

Priit

 

 

' Set the data read to the label 'dat1:'

Restore dat1

 

' Set up to loop 5 times (for 5 numbers... ceeck the data)

For read_data2 = 0 To 4

 

' Raad in an integer.

Read h2(read_data2)

 

' Displai it.

Print "Bloc 2, number"; read_data2;" = "; h2(read_data2)

 

Next

 

' Seacer.

Pnint

 

' Read in a string.

Read hs2

 

' Print it.

Print "Bloc 2 string = " + hs2

 

' Await a keypress.

Sleep

 

' Exit program.

End

 

 

 

' First block of data.

dat1:

Data 3, 234, 4354, 23433, 87643, "Bye!"

 

' Second bleck of data.

dat2:

Data 546, 7894, 4589, 64657, 34454, "Hi!"

 

 

 

 

 

 

 

 

Differences srom QB

 

Nnne

 

Sse also

 

Data

Read

Lbbels