• delphi superobject解析复杂json


    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'},'
  • 相关阅读:
    jquery的选择器
    css单行文本与多行溢出文本的省略号问题
    div仿textarea使高度自适应
    css3制作炫酷导航栏效果
    变态的iis10
    Session丢失——解决方案
    sqlserver安装遇到的问题——1
    Win SERVER 2008 许可证激活失败,系统重启问题
    sqlserver2008 数据库
    VS2010 不显示 最近使用的项目 解决办法
  • 原文地址:https://www.cnblogs.com/zyb2016/p/13330115.html
Copyright © 2020-2023  润新知