Seek statement (LotusScript® Language)

Sets the file position (the byte position in a binary file or the record number in a random file) in an open file.

Syntax

Seek [#]fileNumber , position

Elements

fileNumber

The number assigned to the file when it was opened with the Open statement.

position

The desired file position for the next read or write operation. In a binary or sequential file, this is a non-zero byte location; in a random file, this is a record number (in a random file).

In a binary or sequential file, the first byte is byte number 1; in a random file, the first record is record number 1.

If position is zero or is omitted, Seek returns an error.

Usage

The record number in a Get statement or a Put statement overrides a file position set by a Seek statement.

Writing to a file after moving the file position beyond the end of the file appends data to the end of the file.

Example