Seek Statement

 

Seek filenumber, position

 

The parameter filenumber  is used in the open statement and must be a valid numeric expression, the parameter position is the number that indicates where the next read or write is to occur.  In Cypress Enable Basic position is the byte position relative to the beginning of the file.

 

Seek statement sets the position in a file for the next read or write

 

Related Topics: Open

 

 

Example:

              Sub Main

    Open "TESTFILE" For Input As #1   ' Open file for reading.

    For i = 1 To 24 Step 3     ' Loop until end of file.

      

   Seek #1, i    ' Seek to byte position

   MyChar = Input(1, #1)   ' Read next character of data.

   Print MyChar     'Print character of data

    Next i

    Close #1         ' Close file.

End Sub