[fpc-pascal] Record helper properties
ryan at thealchemistguild.com
Wed Apr 24 01:25:00 CEST 2019
> On Apr 23, 2019, at 6:25 PM, Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> A helper can not access its extended type in its interface, only in its implementation (and yes, this gets important if published properties are involved, which a helper may declare as well).
> Use a getter as a workaround. If you use "inline" chances are high that it will be nearly equal code as if you used a direct access.
Still getting errors. What did I do wrong?
TRec = record
function GetX: integer;
procedure SetX (newValue: integer);
function TRec.GetX: integer;
result := x;
procedure TRec.SetX (newValue: integer);
x := newValue;
THelper = record helper for TRec
property F: integer read GetX write SetX; // ERROR: Unknown class field or method identifier "GetX"
More information about the fpc-pascal