frxJSON用法

frxJSON: TfrxJSON;

frxJSONArrayT: TfrxJSONArray;

frxJSONtemp : TfrxJSON;

begin

S := TStringList.Create;

try

S.LoadFromFile('E:\JSON.txt');

finally

Res:= S.Text; //utf8DEcode( )

FreeAndNil(S);

end;

frxJSON := TfrxJSON.Create(Res);

if frxJSON.IsValid then

frxJSONArrayT := TfrxJSONArray.Create(frxJSON.ObjectByName('Detail'));

frxJSONtemp :=TfrxJSON.CreateWeek(frxJSON.ObjectByName('Main'));

Memo1.Lines.Add('Addr:'+frxJSONtemp.ValueByName('Addr'));

for i:= 0 to frxJSONArrayT.Count-1 do

begin

frxJSONtemp:=frxJSONArrayT.Get(i);

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FMaterialCode'));

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FMaterialName'));

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FColorName'));

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FSizeName'));

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FNum'));

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FPrice'));

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FMoney'));

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FRemark'));

end;

{

"Main":

{

"Title":"主表",

"Client":"客户:上海李明",

"Storge":"仓库:档口仓库",

"Addr":"送货地址:上海人民广场路37弄21号",

"TotalNum":40,

"TotalMoney":1500

},

"Detail":

{ "FMaterialCode":"aaaA", "FColorName":"红", "FSizeName":"M", "FNum":10, "FPrice":30, }, { "FMaterialCode":"款号A", "FColorName":"黄", "FSizeName":"M", "FNum":10, "FPrice":30, }

}

相关推荐
Rabi'2 分钟前
编译ATK源码
前端·webpack·node.js
TG:@yunlaoda360 云老大3 分钟前
华为云国际站代理商备份策略设置过程中遇到问题如何解决?
服务器·数据库·华为云
SelectDB14 分钟前
Doris Catalog 已上线!性能提升 200x,全面优于 JDBC Catalog,跨集群查询迈入高性能分析时代
数据库·数据分析·apache
SoaringHeart22 分钟前
Flutter组件封装:视频播放组件全局封装
前端·flutter
TAEHENGV23 分钟前
进度跟踪模块 Cordova 与 OpenHarmony 混合开发实战
android·javascript·数据库
神秘面具男0332 分钟前
MySQL 从基础到实践
数据库·mysql
离&染2 小时前
vue.js2.x + elementui2.15.6实现el-select滚动条加载数据
前端·javascript·vue.js·el-select滚动加载
inferno2 小时前
HTML基础(第一部分)
前端·html
kirinlau2 小时前
pinia状态管理在vue3项目中的用法详解
前端·javascript·vue.js
2301_767902642 小时前
MySQL 入门
数据库·mysql