[Lazarus] Convert record to JSON?

Bo Berglund bo.berglund at gmail.com
Sun Jul 22 07:50:06 CEST 2018

On Sun, 22 Jul 2018 00:22:58 +0200, Bo Berglund via Lazarus
<lazarus at lists.lazarus-ide.org> wrote:

>Can the JSON handlers deal with the array type TIpAddress?

Well, it trurns out that this fails earlier on when compiling...
So I have:

  TIpAddress = array[0..3] of byte;

  TEspConfiguration = Class(TObject)
    Fchecksum: word;
    Fssid: AnsiString;
    Faddr: TIpAddress;  //<==
    property checksum: word read Fchecksum write Fchecksum;
    property ssid: AnsiString read Fssid write Fssid ;
    property addr: TIpAddress read Faddr write Faddr; // <==

When compiling I get the following error on the "property addr" line:

wificommhandler.pas(97,33) Error: This kind of property cannot be

If I replace the type declaration TIpAddress with array[0..3] of byte
it just adds another error message...

Can published properties only be simple variable types not including
Seems odd since an AnsiString, which is accepted, is just an array of

Bo Berglund
Developer in Sweden

More information about the Lazarus mailing list