Thema: JSON String

Einzelnen Beitrag anzeigen

JensM

Registriert seit: 26. Jan 2020
21 Beiträge
 
Delphi 10.4 Sydney
 
#3

AW: JSON String

  Alt 5. Jan 2021, 12:53
Hey, danke für deine schnelle antwort. Hast du vllt nen kleines beispiel oder nen Programm auschnitt wie man das umsetzt?

Code:
  SLid:=TStringList.Create;
  SLtitle:=TStringList.Create;
  JsonValue := TJSonObject.ParseJSONValue(RESTResponse1.Content);
  for i := 0 to JSonValue.InstanceSize-2 do
    begin
      SLid.Add(JsonValue.GetValue<string>('products['+ Inttostr(i) +'].id'));
      SLtitle.add(JSonValue.GetValue<string>('products['+ Inttostr(i) +'].title'));
    end;
So mache ich das zur zeit. Aber will halt das ID und title variable halten.

danke dir

Geändert von JensM ( 5. Jan 2021 um 12:57 Uhr)
  Mit Zitat antworten Zitat