Now there are 2 libs available json4delphi and uJson:
procedure jsonobjectTest_compare;
// from 1243 unit uPSI_uJSON2;
var
json: TJSONObject; Jobj: TJSONObject2;
Text: String;
i: Integer;
begin
json := TJSONObject.create4(jsonnames);
for i:=0 to json.getJSONArray('Names').Length -1 do begin
Text := json.getJSONArray('Names').getJSONObject(i).optString('FirstName');
//...
writeln(text)
end;
Jobj:= TJSONObject2.create(nil);
jobj.parse(jsonnames);
for i:= 0 to Jobj.count+1 do
writeln(jobj['Names'].asArray[i].asObject['FirstName'].asstring);
jObj.Free;
json.Free;
end;
Now there are 2 libs available json4delphi and uJson: