help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



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

TStream.GetPos

Return current position in the stream

Declaration

Source position: objects.pp line 280

function TStream.GetPos: LongInt; virtual;

Description

If the stream's status is stOk, GetPos returns the current position in the stream. Otherwise it returns -1

Errors

-1 is returned if the status is an error condition.

See also

TStream.Seek

  

Set stream position.

TStream.GetSize

  

Return the size of the stream.

Example

Program ex11;

{ Program to demonstrate the TStream.GetPos function }

Uses objects;

Var L : String;
    S : PStream;

begin
  L:='Some kind of string';
  S:=New(PMemoryStream,Init(100,10));
  Writeln ('Stream position before write: ',S^.GetPos);
  S^.WriteStr(@L);
  Writeln ('Stream position after write : ',S^.GetPos);
  Dispose(S,Done);
end.    

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505