delphi json文件解析

时间:2020-04-08 11:09:22   收藏:0   阅读:212

引用 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;

原文:https://www.cnblogs.com/liguang/p/12658494.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!