[fpc-pascal] TReader Fixups

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Jan 21 01:23:38 CET 2005


I need to stream references in DefineProperties. 

For those not familar with the streaming of TReader/TWriter:

For example TForm.ActiveControl is a class property and is a reference
to TControl. TWriter simply writes the name of the control.
TReader reads the identifier, but during streaming not all controls are
created, so TReader saves this as ToDo in a FFixUps list and sets all
references after loading.
That's a great feature, but it is private. You can not use it in your
DefineProperties. It seems Delphi has the same problem.
Either I'm blind and TReader has already a solution or we need a public
method. For example

procedure TReader.AddFixUp(Instance: TPersistent; PropInfo: Pointer;
  const Ident: string);  
begin
  FFixups.Add(TPropFixup.Create(Instance, Root, PropInfo, '', Ident));
end;

I can write a patch and test it. 


Mattias




More information about the fpc-pascal mailing list