[Overview][Constants][Types][Classes][Procedures and functions][Variables] | Reference for unit 'Classes' (#fcl)

# TStream.Seek

Sets the current position in the stream

## Declaration

`public function TStream.Seek(`
`Offset: LongInt;`
`Origin: Word`
`):LongInt; virtual; overload; function TStream.Seek(`
`Offset: Int64;`
`Origin: TSeekOrigin`
`):Int64; virtual; overload; function TStream.Seek(`
`Offset: LongInt;`
`Origin: Word`
`):LongInt; virtual; abstract;`

## Description

Seek sets the position of the stream to Offset bytes from Origin. Origin can have one of the following values:

Constant | Meaning
soFromBeginning | Set the position relative to the start of the stream.
soFromCurrent | Set the position relative to the beginning of the stream.
soFromEnd | Set the position relative to the end of the stream.

Offset should be negative when the origin is SoFromEnd. It should be positive for soFromBeginning and can have both signs for soFromCurrent

This is an abstract method, which must be overridden by descendent classes. They may choose not to implement this method for all values of Origin and Offset.

## Errors

An exception may be raised if this method is called with an invalid pair of Offset,Origin values. e.g. a negative offset for soFromBeginning.

## See also

TStream.Position |  | The current position in the stream.