9
Trying to understand the JSON in Delphi. Using the module "DBXJSON.pas". How to use it to make this such an array:
Array:[
{"1":1_1,"1_2_1":1_2_2},
...,
]
Doing so:
JSONObject:=TJSONObject.Create;
JSONArray:=TJSONArray.Create();
...
JSONArray.AddElement(TJSONObject.Create(TJSONPair.Create('1','1_1')));
JSONArray.AddElement(TJSONObject.Create(TJSONPair.Create('1_2_1','1_2_2')));
JSONObject.AddPair('Array',JSONArray);
, but get this:
{
"Array":[
{"1":"1_1"},{"1_2_1":"1_2_2"}
]
}
Please help! Thanks!