问题-Delphi7中JSON遍历节点不支持使用IN处理方法?

相关资料:http://www.cnblogs.com/del/archive/2009/10/23/1588690.html

问题现象:在高版本中可以使用IN处理JSON的节点循环问题,可是发现D7不支持。

问题处理: 

Delphi2007源代码:

1 procedure TForm1.Button1Click(Sender: TObject);
2 var
3   jo: ISuperObject;
4   item: ISuperObject; 
5 begin
6   jo := SO(Memo1.Text);
7   for item in jo do
8     Showmessage(item.asjson(false,false));
9 end;

Delphi7源代码:

 1 //使用 TSuperObjectIter 遍历
 2 procedure TForm1.Button8Click(Sender: TObject);
 3 var
 4   jo: ISuperObject;
 5   item: TSuperObjectIter;
 6 begin
 7   jo := SO(Memo1.Text);
 8 
 9   if ObjectFindFirst(jo, item) then
10   repeat
11     ShowMessageFmt('key: %s; val: %s', [item.key, item.val.AsString]);
12   until not ObjectFindNext(item);
13   ObjectFindClose(item);
14 end;
原文地址:https://www.cnblogs.com/FKdelphi/p/5612183.html