Skip to content

SEEK (Statement)


Sets the position of the next read/write operation on a file

Syntax

` Seek [#]filenum, position

`

Parameters

filenum

file number of an opened a file

position

the new position for i/o operations

Description

Sets the position at which the next read or write operation on a file will occur.

The position is given in records if the file was opened in Random access mode, in bytes in any other case. The position is 1 based -- the first record of a file is at position 1.

The Seek function is used to get the position of the next read or write operation.

Examples

start GeSHi

vb
' e.g. if you want to skip to the 100th byte in the file for reading/writing:

Dim f As Long

f = FreeFile
Open "file.ext" For Binary As #f

Seek f, 100

Close #f

end GeSHi

Differences from QB

  • None

See also

  • Seek (Function)
  • Open

Back to DocToc

Translated from FreeBASIC official docs. Contact us for removal if infringed.
FreeBASIC is an open-source project, not affiliated with Microsoft