[Lazarus] Convert record to JSON?
Michael Van Canneyt
michael at freepascal.org
Sun Jul 22 10:41:23 CEST 2018
On Sun, 22 Jul 2018, Bo Berglund via Lazarus wrote:
> On Sun, 22 Jul 2018 07:52:40 +0200 (CEST), Michael Van Canneyt via
> Lazarus <lazarus at lists.lazarus-ide.org> wrote:
>
>> Only dynamic arrays can be published.
>>
> So I changed the declaration:
>
> TIpAddress = array of byte;
>
> Then added a constructor to the class where I set the length to 4:
>
> constructor TEspConfiguration.Create;
> begin
> SetLength(Faddr,4);
> end;
>
> This removed the errors I had before but popped up another one in my
> main code:
>
> String2IP(FConfRec.addr, edWiFiAddress.Text); //<== Error here
>
> formmainconfig.pas(240,26) Error: Can't take the address of constant
> expressions
That is because you cannot pass the array as a var argument. Just remove the
var, for a dynamic array it is not required anyway.
Michael.
More information about the Lazarus
mailing list