TStream.GetSize function
Return the size of the stream.
Declaration
function GetSize: LongInt; virtualDescription
If the stream's status is
stOk then
GetSize returns
the size of the stream, otherwise it returns
-1.
Errors
-1 is returned if the status is an error condition.See also
Example: ex12
Program ex12;
{ Program to demonstrate the TStream.GetSize function }
Uses objects;
Var L : String;
S : PStream;
begin
L:='Some kind of string';
S:=New(PMemoryStream,Init(100,10));
Writeln ('Stream size before write: ',S^.GetSize);
S^.WriteStr(@L);
Writeln ('Stream size after write : ',S^.GetSize);
Dispose(S,Done);
end.An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
