You are not logged in.
Pages: 1
Hi,
First of all, thank you a lot for this great framework, really amazing work.
I have a problem compiiling my project under lazarus/fpc targeting linux, my TsqlRecord which include a record property can't compile under fpc, i got an error indicate that record cannot be used as published property !
I tried with the sample project 21 - http performance, i added a record property to the TSqlRecordPeople, and i got the same error.
Maybe some missing RTTI, i tried FPC, new pascal and got the same error!
Any solution ?
type
TTest = record
name : RawUTF8;
end;
TSQLRecordPeople = class(TSQLRecord)
private
fFirstName: RawUTF8;
fLastName: RawUTF8;
fYearOfBirth: integer;
fYearOfDeath: word;
fTest : TTest;
published
property FirstName: RawUTF8 read fFirstName write fFirstName;
property LastName: RawUTF8 read fLastName write fLastName;
property YearOfBirth: integer read fYearOfBirth write fYearOfBirth;
property YearOfDeath: word read fYearOfDeath write fYearOfDeath;
property Test : TTest read fTest write fTEst;
end;
regards.
Offline
Indeed, records can't be used as published property since there is no RTTI for them in FPC... at least the last time we checked...
This is a FPC limitation (similar to Delphi < XE5).
You may try to define the PUBLISHRECORD conditional, and see if it works....
As a workaround, the idea is to use a TDocVariant or a RawJSON published property, then some function as getter/setter records for high-level code...
Offline
Thank you for your quick answer ! TDocVariant is a good alternative.
Regards.
Offline
We have plan to support this in NewPascal
best regards,
Maciej Izak
Offline
Pages: 1