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, }

}

相关推荐
超级大只老咪1 分钟前
字段行居中(HTML基础语法)
前端·css·html
IT_陈寒14 分钟前
Python开发者必看!10个高效数据处理技巧让你的Pandas代码提速300%
前端·人工智能·后端
l1t17 分钟前
用parser_tools插件来解析SQL语句
数据库·sql·插件·duckdb
只_只30 分钟前
npm install sqlite3时报错解决
前端·npm·node.js
FuckPatience35 分钟前
Vue ASP.Net Core WebApi 前后端传参
前端·javascript·vue.js
TDengine (老段)35 分钟前
TDengine 数学函数 ABS() 用户手册
大数据·数据库·sql·物联网·时序数据库·tdengine·涛思数据
数字冰雹36 分钟前
图观 流渲染打包服务器
服务器·前端·github·数据可视化
lypzcgf37 分钟前
Coze源码分析-资源库-编辑数据库-后端源码-安全与错误处理
数据库·安全·系统架构·coze·coze源码分析·ai应用平台·agent平台
阿湯哥37 分钟前
Redis数据库隔离业务缓存对查询性能的影响分析
数据库·redis·缓存