首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用Brightscript解析JSON

用Brightscript解析JSON
EN

Stack Overflow用户
提问于 2013-10-03 13:44:31
回答 1查看 3.2K关注 0票数 2

我正在尝试解析JSON,基于下面的示例:http://blog.roku.com/developer/2012/07/16/json-support-comes-to-roku/

代码语言:javascript
复制
jsonAsString = ReadAsciiFile("pkg:/json/sample1.json")
m.json = ParseJSON(jsonAsString)
ShowPosterScreen(m.json.Videos, true)

我在调试器控制台中得到以下消息:

代码语言:javascript
复制
Current Function:
057: Function LoadJSONFile() as void
058:     jsonAsString = ReadAsciiFile("pkg:/json/sample1.json")
059:     m.json = ParseJSON(jsonAsString)
060:     ShowPosterScreen(m.json.Videos, true)
061: End Function
'Dot' Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec) in ...AALAE4Bk/pkg:/source/main.brs(60)
060:     ShowPosterScreen(m.json.Videos, true)
Backtrace:
Function loadjsonfile() As
   file/line: /tmp/plugin/D...AALAE4Bk/pkg:/source/main.brs(60)
Function handlebuttonpress(id As Integer) As
   file/line: /tmp/plugin/D...AALAE4Bk/pkg:/source/main.brs(51)
Function main() As
   file/line: /tmp/plugin/D...AALAE4Bk/pkg:/source/main.brs(26)
Local Variables:
global   &h0020 rotINTERFACE:ifGlobal
m        &h0010 bsc:roAssociativeArray, refcnt=4
jsonasstring &h8010 bsc:roString (2.1 was String), refcnt=1
BrightScript Debugger>

更新:如果我包含一个Makefile并压缩内容并通过开发加载,browser...it工作。在通过Eclipse导出时不能工作。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-10-09 00:33:00

这听起来像是Eclipse插件中的一个bug,很可能在某种程度上它没有加载包含您的ShowPosterScreen函数的文件。

请查看Roku论坛,最上面是讨论Eclipse插件的部分。这里有一个直接的联系。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19160863

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档