[Lazarus] windows EStackOverflow if compiled with -WG

2018-07-20 Thread Andreas Frieß via Lazarus
I make a project according the sample in http://wiki.freepascal.org/Form_in_DLL Compile the programm with -WG activated and started in Commandline direct, i got a EStackOverflow if i open the form in the dll Compile the programm with -WG deactivated and started in Commandline direct, it runs

[Lazarus] Convert record to JSON?

2018-07-20 Thread Bo Berglund via Lazarus
I have an application that manages the configuration of an embedded device, which communicates over TCP/IP. Currently I have implmented a protocol with a command identifier for each data item and the way to send the data is by sending a packet with the command ID plus the data to the open socket.

Re: [Lazarus] Convert record to JSON?

2018-07-20 Thread AlexeyT via Lazarus
The config data are stored in a record and consists of a mix of data types like strings and numbers as well as booleans. Is there a simple way to encode the record as a JSON message Yes, it is. You can write to json values by path: /dir1/dir2/dir3/key, so for your record, make string paths fo

Re: [Lazarus] Convert record to JSON?

2018-07-20 Thread Bo Berglund via Lazarus
On Fri, 20 Jul 2018 20:09:25 +0300, AlexeyT via Lazarus wrote: > >> The config data are stored in a record and consists of a mix of data >> types like strings and numbers as well as booleans. >> Is there a simple way to encode the record as a JSON message > >Yes, it is. You can write to json valu

Re: [Lazarus] Convert record to JSON?

2018-07-20 Thread Michael Van Canneyt via Lazarus
On Fri, 20 Jul 2018, Bo Berglund via Lazarus wrote: On Fri, 20 Jul 2018 20:09:25 +0300, AlexeyT via Lazarus wrote: The config data are stored in a record and consists of a mix of data types like strings and numbers as well as booleans. Is there a simple way to encode the record as a JSON

Re: [Lazarus] Convert record to JSON?

2018-07-20 Thread AlexeyT via Lazarus
On 20.07.2018 20:33, Bo Berglund via Lazarus wrote: So I have two issues here: 1) It seems like there is no RecordToJSONString method only ObjectToJSONString. No function; I was suggesting to make it (func) to your record type (each rec type has its new function). So record type will convert t

Re: [Lazarus] Convert record to JSON?

2018-07-20 Thread Bo Berglund via Lazarus
On Fri, 20 Jul 2018 19:33:19 +0200, Bo Berglund via Lazarus wrote: I changed my code now so my recrd is instead an object: type TMyRecord = Class(TObject) checksum: word; ssid: AnsiString; passwd: AnsiString; macaddr: AnsiString; addr: TIpAddress; baud: integer; tcppo