Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-05

TFiler.DefineBinaryProperty ReadData size problem

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Dear All,

procedure TspCompressedStoredSkin.DefineProperties(Filer: TFiler);
begin
  inherited;
  Filer.DefineBinaryProperty('CompressedData', ReadData, WriteData, True);
end;
procedure TspCompressedStoredSkin.ReadData;
begin
  FCompressedStream.LoadFromStream(Reader);
end;

On Delphi, this method returns rigth size(38750 byte) and it's work. but on Lazarus returns wrong size(38764 byte).
Why? Is it a bug?

Thanks
Best regards,

Brian

Reply by email

Mattias Gaertner
to Unknown author
Show quoted text 12 lines
Dear All, procedure TspCompressedStoredSkin.DefineProperties(Filer: TFiler); begin inherited; Filer.DefineBinaryProperty('CompressedData', ReadData, WriteData, True); end; procedure TspCompressedStoredSkin.ReadData; begin FCompressedStream.LoadFromStream(Reader); end;

What is FCompressedStream?
ReadData is missing the parameter.

On Delphi, this method returns rigth size(38750 byte) and it's work. but on Lazarus returns wrong size(38764 byte). Why? Is it a bug?

Mattias

Reply by email

Unknown author
Show quoted text 14 lines
Dear All, procedure TspCompressedStoredSkin.DefineProperties(Filer: TFiler); begin inherited; Filer.DefineBinaryProperty('CompressedData', ReadData, WriteData, True); end; procedure TspCompressedStoredSkin.ReadData; begin FCompressedStream.LoadFromStream(Reader); end; >What is FCompressedStream? >ReadData is missing the parameter.

FCompressedStream IS TMemoryStream.

On Delphi, this method returns rigth size(38750 byte) and it's work. but on Lazarus returns wrong size(38764 byte). Why? Is it a bug?

Mattias

Reply by email

Mattias Gaertner
to Unknown author
Show quoted text 18 lines
On Tue, 20 May 2008 14:26:53 +0800 (CST) wrote: > Dear All, > > procedure TspCompressedStoredSkin.DefineProperties(Filer: TFiler); > begin > inherited; > Filer.DefineBinaryProperty('CompressedData', ReadData, WriteData, > True); end; > > procedure TspCompressedStoredSkin.ReadData; begin > FCompressedStream.LoadFromStream(Reader); > end; >>What is FCompressedStream? >>ReadData is missing the parameter. FCompressedStream IS TMemoryStream.

Something like that:

procedure TspCompressedStoredSkin.ReadData(Reader: TStream);
begin
  FCompressedStream.Position:=0;
  FCompressedStream.LoadFromStream(Reader);
  ...
end;

?
This should work the same as Delphi.

Show quoted text 5 lines
> On Delphi, this method returns rigth size(38750 byte) and it's work. > but on Lazarus returns wrong size(38764 byte). > Why? Is it a bug? From what kind of stream are you reading? .lfm, .xml? Under what

platform and which fpc version?
Can you post a more complete example?

Mattias

Reply by email