delphi json文件解析

引用 JsonGYFunctions.pas  

JSONObject :=TJsonObject.Parse(Memo1.Text) as TJsonObject;

//result是json中的一个数组

for j := 0 to JSONObject.A['result'].Count-1 do
begin
JSONObject1 := JSONObject.A['result'].O[j];

businessMode:=JSONObject1.S['businessMode'];

 

 

weather获取的是result中的arrivalPlanList数组

weather := JSONObject1.A['arrivalPlanList'];

for i := 0 to weather.Count - 1 do //应该是4条记录
begin

//得到weather的值
result := result + '|' +weather.O[i].S['instanceId'];
end;
end;

posted on 2020-04-08 10:52  liguang178  阅读(2847)  评论(0)    收藏  举报