[fpc-pascal] Assign() vs AssignTo()

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Thu Feb 11 17:17:32 CET 2016


On 2016-02-11 15:55, Martin Schreiber wrote:
> It depends on what knows to handle what. Sometimes both have to be overridden.

Thanks Martin and Andreas. So it's more about which direction you want
to go.

Now the other thing that surprised be, I thought TPersistent.Assign()
automatically handles protected properties (via RTTI) - thinking that
descendants automatically get such functionality for free. But reviewing
the RTL code, I see Assign() and AssignTo() really has no functionality
implemented by default.

I can only assume that the reason I thought published properties are
handled for you (in the RTL), was because 99.9% of my projects are tiOPF
based, and it always just worked. Looking now at this in more detail, I
see it was indeed tiOPF that always gave me that functionality. Wow, 17+
years later and I only realise that now. :) Never too old to learn. ;-)

Regards,
  - Graeme -





More information about the fpc-pascal mailing list