Delphi-Quellcode:
for i := 0 to JSonArray.Count - 1 do
begin
JsonValue := TJsonValue.ParseJSONValue(st);
if (JSONValue is TJSONArray) then
id := ((JSONValue as TJSONArray).Items[i] as TJSonObject).Get('id').JSONValue.Value;
name := ((JSONValue as TJSONArray).Items[i] as TJSonObject).Get('name').JSONValue.Value;
stringgrid1.Cells[1,j] := id;
Delphi-Quellcode:
for i := 0 to JSonArray.Count - 1 do
begin
JsonValue := TJsonValue.ParseJSONValue(st);
if (JSONValue is TJSONArray) then
begin
id := ((JSONValue as TJSONArray).Items[i] as TJSonObject).Get('id').JSONValue.Value;
name := ((JSONValue as TJSONArray).Items[i] as TJSonObject).Get('name').JSONValue.Value;
stringgrid1.Cells[1,j] := id;
end;
Was fällt dir auf?
Delphi-Quellcode:
for i := 0 to JSonArray.Count - 1 do
begin
JsonValue := TJsonValue.ParseJSONValue(st);
try
if (JSONValue is TJSONArray) then
begin
id := ((JSONValue as TJSONArray).Items[i] as TJSonObject).Get('id').JSONValue.Value;
name := ((JSONValue as TJSONArray).Items[i] as TJSonObject).Get('name').JSONValue.Value;
stringgrid1.Cells[1,j] := id;
end;
finally
JsonValue.Free;
end;
Tipp: Füge mal ein
ReportMemoryLeaksOnShutdown := True;
in deine
DPR oder ins OnCreate deiner Form ein.
Anzahl = Count
Bereich = 0 bis Anzahl-1
oder 1 bis Anzahl
10 = 0 bis 9 (0 1 2 3 4 5 6 7 8 9 = 10 Zahlen)
oder
10 = 1 bis 10 (1 2 3 4 5 6 7 8 9 10 = auch 10 Zahlen)
wenn bei 1 begonnen wird zu zählen
oder
10 = 99998 bis 100007