On Tue, 28 Jan 2014, luciano de souza wrote:

Hello all,

JSON is a very easy format to handle with Freepascal. However, the
output is not so readable when the number of registers increase. An
example of it is:

[snip]

The corresponding output is:

{ "people" : [{ "name" : "Luciano de Souza", "age" : 38, "city" :
"NiterĂ³i", "country" : "Brazil" }, { "name" : "Mariella Molinari",
"age" : 29, "city" : "Padova", "country" : "Italy" }] }

My question is: is there a way to automatically format it? Breaking
lines? Becoming easy the reading?

Yes. Use the FormatJSON function.
Note that it is slower than the AsJSON function, because of the formatting.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to