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

}

相关推荐
橙子家13 小时前
浏览器缓存之【基础键值存储】:Local storage 和 Session storage
前端
星星在线15 小时前
MusicFree:一个「All in One」的个人音乐服务器,让听歌回归简单
前端·后端
IT_陈寒16 小时前
Redis的SETNX并发问题让我加了三天班
前端·人工智能·后端
demo007x17 小时前
Docling 文档转换以及技术架构分析
前端·后端·程序员
京东云开发者17 小时前
京东市民服务又“上新”!这次是黑龙江“龙易办”
前端
袋鱼不重18 小时前
我的神奇同事,AI 用多了居然写了个 Open In Codex
前端·后端·ai编程
LDR00618 小时前
Type-C 快充全面升级!LDR6601 赋能个人护理便携电机,重塑剃须刀 / 理发器新体验
c语言·开发语言
Fireworks18 小时前
深入vue3源码解读 -- 1、响应式的基础概念
前端
程序员黑豆18 小时前
JDK 下载安装与配置详细教程
java·前端·ai编程
hunterandroid18 小时前
文件存储:内部存储与外部存储
前端