On Thu, 15 Aug 2024, Mattias Gaertner via fpc-devel wrote:

Hi,

What is the state of published record in fpc trunk?

You cannot publish records, and this is not planned.

This is because things like

MyClass.MyRecord.MyField:=12;

do not work as one would naively expect. It does work if you use a TPersistent
instead of a record (the very reason the TPersistent class was invented)

However, you can use extended RTTI to access this typeinfo and manipulate the record. That works.

Michael.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to