开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 775|回复: 8
收起左侧

[完成] 小白求助,json取成员到文本

 关闭 [复制链接]
结帖率:17% (1/6)
发表于 2023-11-20 09:49:49 | 显示全部楼层 |阅读模式   山东省菏泽市
5精币
我想取params[1].params.table中的两个成员到文本,用jsonx.取成员 (“params[1].params.table”, 0).到文本 ()这个取到的只是第一个成员的文本,怎么把两个成员一块取出来,取到的内容应该为   {"Name":"IPC1"},{"Name":"IPC2"}       ,麻烦大佬们给个例子

json原文:
[JavaScript] 纯文本查看 复制代码
{"id":195,"params":[{"id":189,"params":{"table":[{"AnimalDetectTitle":null,"ChannelTitle":{"BackColor":[0,0,0,128],"EncodeBlend":true,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[148,7511,2769,7949],"TextAlign":2},"Covers":[{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[0,0,1024,1024]},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[1024,1024,2048,2048]},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[2048,2048,3072,3072]},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[3072,3072,4096,4096]}],"CustomTitle":[{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[5321,7450,7931,7868],"Text":"","TextAlign":2},{"BackColor":[0,0,0,128],"EncodeBlend":true,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[5321,7450,7931,7868],"Text":"山东|菏泽|郓城|南城|工商局家属院","TextAlign":2},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[5321,7450,7931,7868],"Text":"","TextAlign":2},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[5321,7450,7931,7868],"Text":"","TextAlign":2}],"ElevatorFloorOSD":{"BackColor":[0,0,0,128],"EncodeBlend":true,"FrontColor":[255,255,255,0],"Rect":[150,360,2771,793],"TextAlign":0},"FontSize":0,"FontSizeExtra1":0,"FontSizeExtra2":0,"FontSizeExtra3":0,"FontSizeScale":1,"FontSizeSnapshot":0,"OSDMobileState":{"BackColor":[0,0,0,128],"EncodeBlend":true,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[6295,920,7929,1351]},"PTZCoordinates":{"BackColor":[0,0,0,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"PTZDirection":{"BackColor":[0,0,0,128],"DisplayTime":5,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"PTZOSDMenu":{"BackColor":[0,1,1,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"PTZOSDMenuViaApp":{"BackColor":[0,0,0,128],"DisplayTime":60,"EncodeBlend":false,"EncodeBlendExtra1":true,"EncodeBlendExtra2":true,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[281,1477,2897,1542]},"PTZPreset":{"BackColor":[0,0,0,128],"DisplayTime":5,"EncodeBlend":false,"FrontColor":[255,255,255,3],"PreviewBlend":false,"Rect":[475,1442,475,1442]},"PTZZoom":{"BackColor":[0,0,0,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"PictureTitle":{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"Name":"osd.bmp","PreviewBlend":false,"Rect":[0,0,128,128]},"PortraitFlowStat":{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"Rect":[148,263,1773,680],"ShowFaceFlowStat":true,"ShowHumanFlowStat":true,"TextAlign":0},"PtzPattern":{"BackColor":[0,0,0,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"PtzRS485Detect":{"BackColor":[0,0,0,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"RoadFlowTitle":{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"MotorOrNon":{"ShowMotorFlowStat":false},"Rect":[147,261,2769,697],"ShowMode":1,"TextAlign":0},"Temperature":{"BackColor":[0,0,0,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320],"TemperatureUnit":"Centigrade"},"TimeTitle":{"BackColor":[0,0,0,128],"EncodeBlend":true,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[5319,352,7929,769],"ShowWeek":false,"WeekPosition":"Right"},"TrafficFlowTitle":{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"Human":{"ShowHumanFlowStat":false},"MotorOrNon":{"ShowMotorFlowStat":false,"ShowNonMotorFlowStat":false},"Rect":[147,261,2769,697],"ShowMode":1,"TextAlign":0},"UserDefinedTitle":[{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[148,352,1773,769],"Text":""},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[148,352,1773,769],"Text":""},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[148,352,1773,769],"Text":""},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[148,352,1773,769],"Text":""}],"VoltageStatus":{"BackColor":[0,0,0,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[541,3320,541,3320]},"WideHeightRatio":0}]},"result":true},{"id":190,"params":{"table":[{"Name":"IPC1"},{"Name":"IPC2"}]},"result":true},{"id":191,"params":{"table":[{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"Rect":[148,263,1773,680],"ShowEnterNum":true,"ShowExitNum":true,"TextAlign":0},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"Rect":[148,263,1773,680],"ShowEnterNum":true,"ShowExitNum":true,"TextAlign":0}]},"result":true},{"error":{"code":268959743,"message":"Unknown error! error code was not set in service!"},"id":192,"params":{"table":null},"result":false},{"id":193,"params":{"table":[{"OSDLineSpacing":0},{"OSDLineSpacing":0}]},"result":true},{"error":{"code":268959743,"message":"Unknown error! error code was not set in service!"},"id":194,"params":{"table":null},"result":false}],"result":true,"session":"194d25c834da09f57665dca3bc8930bd"}

最佳答案

结帖率:100% (1/1)

签到天数: 22 天

发表于 2023-11-20 09:49:50 | 显示全部楼层   河南省郑州市
新建 易程序 4.e (958.17 KB, 下载次数: 10)

评分

参与人数 1荣誉 +1 收起 理由
项目部004 + 1 热心帮助他人,荣誉+1,希望继续努力(*^__^*) 嘻嘻!

查看全部评分

回复

使用道具 举报

结帖率:100% (1/1)

签到天数: 22 天

发表于 2023-11-20 09:54:38 | 显示全部楼层   河南省郑州市
  
变量名类 型静态数组备 注
json类_json 
json.解析 ( #常量1, , )
调试输出 (json.取通用属性 (“['params'][1]['params']['table']”, ))


i支持库列表   支持库注释   
spec特殊功能支持库
回复

使用道具 举报

结帖率:17% (1/6)
 楼主| 发表于 2023-11-20 09:59:13 | 显示全部楼层   山东省菏泽市
afu45 发表于 2023-11-20 09:54
[e=0].版本 2
.支持库 spec

这个和我写的是一样的把    没有一块取出来

点评

哪里一样了?   河南省郑州市  发表于 2023-11-20 10:00
回复

使用道具 举报

结帖率:100% (8/8)
发表于 2023-11-20 10:17:16 | 显示全部楼层   广西壮族自治区南宁市
JSON.取属性 (“params[1].params.table[0]”).取数据文本 ()
JSON.取属性 (“params[1].params.table[1]”).取数据文本 ()
回复

使用道具 举报

结帖率:80% (8/10)

签到天数: 19 天

发表于 2023-11-20 10:17:43 | 显示全部楼层   天津市天津市
JSON.取属性 (“params[1]”).取数据文本 ()
JSON.取属性 (“params[1].params.table”).取数据文本 ()
回复

使用道具 举报

结帖率:100% (8/8)
发表于 2023-11-20 10:30:42 | 显示全部楼层   广西壮族自治区南宁市
  
子程序名返回值类型公开备 注
功能_取JSON值  
变量名类 型静态数组备 注
JSON类_json 
局_结果逻辑型 
i整数型 
局_结果 = JSON.解析 ( #常量_tmp, , )
计次循环首 (JSON.成员数 (“params[1].params.table”), i)
调试输出 (JSON.取属性 (“params[1].params.table[”到文本 (i - 1)“]”).取数据文本 ())
计次循环尾 ()


i支持库列表   支持库注释   
spec特殊功能支持库

回复

使用道具 举报

发表于 2023-11-20 11:25:42 | 显示全部楼层   广东省广州市
转对象取,或者直接按文本取
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 793400750,邮箱:wp@125.la
网站简介:精易论坛成立于2009年,是一个程序设计学习交流技术论坛,隶属于揭阳市揭东区精易科技有限公司所有。
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表