You are not logged in.
Pages: 1
Hi Dear All,
I want to use the Json library as a standalone unit in my project.
I am using D2007 and would want some help in creating , reading and parsing individual data elements json data.
Particularly how to create Json Array types in code without a seed data aka { "items": [...]}.
Trying to migrate my data transfer format from xml to json.
Thanks
Offline
You would find everthing you need in SynCommons.pas.
Take a look at the TDocVariant custom variant type.
See http://synopse.info/files/html/Synopse% … ml#TITL_80
Offline
Thanks Boss,
I may be not qualified to say what a powerful framework you have built.
I just tried my hands at below code and I have an idea how I am going to solve the issue I have in my project.
TDocVariant.New(JsonObject);
JsonObject.SessionDate := '01012016';
JsonObject.TotalItemsCount := 29;
JsonObject.TotalItemsValue := 290.87;
JsonObject.Transactions := _Arr([]);
for i := 0 to 100 - 1 do
begin
TDocVariant.New(anElement);
anElement.ItemName := 'item ' + IntToStr(i);
anElement.ItemPrice := 10*i;
JsonObject.Transactions.Add(anElement);
end;
Memo1.Lines.Text := JsonObject;
The only issue I have in using this framework is the documentation is not simplified to get one up and going.
The appeal I am making is that, can we have a getting started sort of document.
This is key because it will ease the early pains of adopting the framework.
I have tried so many times to use the framework but to no avail.
But I have been able to adopt Java frameworks such as SparkJava and Dropwizard
in a matter of 2 hours mainly because the documentation is very simplified.
Thanks.
I sincerely hope I can you this framework in my next project where I shall convert an Old Asta based server to Mormot
Offline
Hi AArhin,
This might be of helpful: https://tamingthemormot.wordpress.com/
Aside from that, I'm afraid at this moment you'll have to bear with this fact
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
You can't compare mORMot with this two lightweight frameworks/libraries. Sure, you need only JSON, but the docu is about all.
To understand mORMot you need a year. It is not easy, but if you really need it, there is no other way.
Offline
Agreed! start from the supplied samples (over 30 samples!) and it's very very easy to understand.
Last edited by edwinsn (2015-12-26 13:23:09)
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Pages: 1