• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

delphisuperobject解析复杂json

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
var
  JO, JO1, JO2, JRec: ISuperObject;
  JA1,JA2:TSuperArray;
  JT:TSuperAvlTree;
  JTI:TSuperAvlIterator;
  iCount,iField:integer;
begin
  JT := SO(memo1.lines.text).A['result'][0].AsObject;
  iCount := JT.count;
      //ShowMessage(inttostr(iCount));
  if iCount > 0 then
    JTI := JT.GetEnumerator;
  jti.First;
  if JTI.Current <> nil then
  begin
    JO1 := JTI.Current.Value;
    //ShowMessageFmt('%s %s %s %f', [JTI.Current.name, JO1.S['date'], JO1.S['time'], JO1.C['bankConversionPri']]);
    Memo2.Lines.Add(JTI.Current.name+JO1.S['date']+ JO1.S['time']+ '  汇率:'+JO1.S['bankConversionPri']);
    while JTI.MoveNext do
    begin
      JO1 := JTI.Current.Value;
      //ShowMessageFmt('%s %s %s %f', [JTI.Current.name, JO1.S['date'], JO1.S['time'], JO1.C['bankConversionPri']]);
      Memo2.Lines.Add(JTI.Current.name+JO1.S['date']+ JO1.S['time']+ '  汇率:'+JO1.S['bankConversionPri']);
    end;
  end;
end;

  

'{'
      #9'"error_code": 0,'
      #9'"resultcode": "200",'
      #9'"reason": "SUCCESSED!",'
      #9'"result": ['
      #9#9'{'
      #9#9#9'"'#32654#20803'": {'
      #9#9#9#9'"bankConversionPri": "699.8200",'
      #9#9#9#9'"date": "2020-07-15",'
      #9#9#9#9'"fBuyPri": "698.9300",'
      #9#9#9#9'"fSellPri": "701.9000",'
      #9#9#9#9'"mBuyPri": "693.2500",'
      #9#9#9#9'"mSellPri": "701.9000",'
      #9#9#9#9'"name": "'#32654#20803'",'
      #9#9#9#9'"time": "11:30:02"'
      #9#9#9'},'
      #9#9#9'"'#27431#20803'": {'
      #9#9#9#9'"bankConversionPri": "798.4700",'
      #9#9#9#9'"date": "2020-07-15",'
      #9#9#9#9'"fBuyPri": "795.7400",'
      #9#9#9#9'"fSellPri": "801.6100",'
      #9#9#9#9'"mBuyPri": "771.0200",'
      #9#9#9#9'"mSellPri": "804.1900",'
      #9#9#9#9'"name": "'#27431#20803'",'
      #9#9#9#9'"time": "11:30:02"'
      #9#9#9'},'
      #9#9#9'"'#28207#24065'": {'
      #9#9#9#9'"bankConversionPri": "90.2800",'
      #9#9#9#9'"date": "2020-07-15",'
      #9#9#9#9'"fBuyPri": "90.1700",'
      #9#9#9#9'"fSellPri": "90.5300",'
      #9#9#9#9'"mBuyPri": "89.4600",'
      #9#9#9#9'"mSellPri": "90.5300",'
      #9#9#9#9'"name": "'#28207#24065'",'
      #9#9#9#9'"time": "11:30:02"'
      #9#9#9'},'

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
朝花夕拾--delphi的三层结构发布时间:2022-07-18
下一篇:
DELPHI enablecontrols,disablecontrols函数发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap