[fpc-devel] Read from memory stream with position before start of file

Paul Ishenin webpirat at mail.ru
Fri Jan 2 15:17:21 CET 2009


Michael Van Canneyt wrote:
> And writing ?
>   
Silently do nothing:

procedure TForm4.Button1Click(Sender: TObject);
var
  S: TMemoryStream;
  B: Byte;
  Count: Integer;
begin
  S := TMemoryStream.Create;
  S.Position := -1;
  B := 1;
  S.Write(B, SizeOf(B));
  ShowMessage(IntToStr(S.Size));
  S.Free;
end;

it shows 0

Best regards,
Paul Ishenin.



More information about the fpc-devel mailing list