Einzelnen Beitrag anzeigen

Pfaffe

Registriert seit: 29. Jan 2009
297 Beiträge
 
Delphi 12 Athens
 
#8

AW: JSON iterieren, aber wie?

  Alt 26. Sep 2022, 08:26
So gehts:
Delphi-Quellcode:
// subobj: TJSONObject;
subobj_dimensions := subobj.Values['dimensions'] as TJSONObject;
var subobj_length := subobj_dimensions.Values['length'] as TJSONArray;
Memo1.Lines.Add('length = ' + subobj_length.Items[0].Value + ' ' + subobj_length.Items[1].Value);
var subobj_width := subobj_dimensions.Values['width'] as TJSONArray;
Memo1.Lines.Add('width = ' + subobj_width.Items[0].Value + ' ' + subobj_width.Items[1].Value);
var subobj_height := subobj_dimensions.Values['height'] as TJSONArray;
Memo1.Lines.Add('height = ' + subobj_height.Items[0].Value + ' ' + subobj_height.Items[1].Value);
  Mit Zitat antworten Zitat