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

}

相关推荐
We་ct12 分钟前
LeetCode 4. 寻找两个正序数组的中位数:二分优化思路详解
前端·数据结构·算法·leetcode·typescript·二分
H@Z*rTE|i16 分钟前
vue首屏加载优化
前端·javascript·vue.js
FreeBuf_17 分钟前
新型开源供应链攻击:虚假 npm 安装日志暗藏 RAT 木马
前端·npm·开源
Irene199118 分钟前
v-model 的本质,defineModel() 是 Vue 3.4 的重大改进
前端·javascript·html5
yoyo_zzm31 分钟前
MySQL数据库误删恢复_mysql 数据 误删
数据库·mysql·adb
小恶魔巴巴塔33 分钟前
C语言避免头文件循环
c语言·开发语言
F1FJJ44 分钟前
Shield CLI 的 PostgreSQL 插件 v0.5.0 发布:数据库导出 + 协作增强,ER 图全新体验
网络·数据库·docker·postgresql·go
EF@蛐蛐堂1 小时前
【vue】Vite 生态 5 个 “新玩具“
前端·javascript·vue.js
风之舞_yjf1 小时前
Vue基础(29)_props配置项、ref属性
前端·vue.js
weixin199701080161 小时前
《深入浅出:图解淘宝分布式数据库TDDL(及开源替代方案)》
数据库·分布式·开源