API:System.Classes.TBufferedFileStream.Seek

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override;

C++

virtual __int64 __fastcall Seek(const __int64 Offset, TSeekOrigin Origin)/* overload */;
inline int __fastcall  Seek(int Offset, System::Word Origin){ return TStream::Seek(Offset, Origin); }

Properties

Type Visibility Source Unit Parent
function public
System.Classes.pas
System.Classes.hpp
System.Classes TBufferedFileStream

Description

Resets the current position of the handle stream.

System.Classes.TBufferedFileStream.Seek inherits from System.Classes.THandleStream.Seek. All content below this line refers to System.Classes.THandleStream.Seek.

Resets the current position of the handle stream.

Use Seek to move the current position within the resource associated with the handle stream by the indicated offset. Seek allows an application to read from or write to a particular location within the resource.

The Origin parameter indicates how to interpret the Offset parameter. Origin should be one of the following values:

Value Meaning

soFromBeginning

Offset is from the beginning of the resource. Seek moves to the position Offset. Offset must be >= 0.

soFromCurrent

Offset is from the current position in the resource. Seek moves to Position + Offset.

soFromEnd

Offset is from the end of the resource. Offset must be <= 0 to indicate a number of bytes before the end of the file.

Or you can also use TSeekOrigin and its values to indicate where to start a seek operation.

Seek returns the new value of the Position property, the new current position in the resource.

See Also