qq245267997 Posted February 28, 2020 Posted February 28, 2020 i use getRangesList() and Returns A list table with memory regions. Each element is a table with fields: state, start, end, type, name, internalName. like temp = getRangesList(); when i get temp[1].end value , it will appear error. the name cant be 'end'
Administrators Enyby Posted February 28, 2020 Administrators Posted February 28, 2020 You must specify exact code and exact text of error.
qq245267997 Posted February 28, 2020 Author Posted February 28, 2020 41 minutes ago, Enyby said: You must specify exact code and exact text of error. Thanks for your reply. code: List = gg.getRangesList() Range = List[1].start - List[1].end --error gg.alert(Range) print(List) text of error: 脚本已结束:: 脚本错误: luaj.LuaError: load /storage/emulated/0/Pictures/Script.lua: luaj.LuaError: /storage/emulated/0/Pictures/Script.lua:6 `Range = List[1].start - List[1].end --error` '<name>' expected near 'end' at luaj.LuaValue.error(LuaValue.java:997) at luaj.Globals.loadfile(Globals.java:255) at android.ext.Script.runScript(Script.java:5825) at android.ext.Script$ScriptThread.run(Script.java:5618) Caused by: luaj.LuaError: /storage/emulated/0/Pictures/Script.lua:6 `Range = List[1].start - List[1].end --error` '<name>' expected near 'end' at luaj.compiler.LexState.lexerror(LexState.java:295) at luaj.compiler.LexState.syntaxerror(LexState.java:299) at luaj.compiler.LexState.error_expected(LexState.java:989) at luaj.compiler.LexState.check(LexState.java:1002) at luaj.compiler.LexState.str_checkname(LexState.java:1030) at luaj.compiler.LexState.checkname(LexState.java:1041) at luaj.compiler.LexState.fieldsel(LexState.java:1287) at luaj.compiler.LexState.suffixedexp(LexState.java:1552) at luaj.compiler.LexState.simpleexp(LexState.java:1628) at luaj.compiler.LexState.subexpr(LexState.java:1741) at luaj.compiler.LexState.subexpr(LexState.java:1750) at luaj.compiler.LexState.expr(LexState.java:1759) at luaj.compiler.LexState.explist(LexState.java:1459) at luaj.compiler.LexState.assignment(LexState.java:1854) at luaj.compiler.LexState.exprstat(LexState.java:2176) at luaj.compiler.LexState.statement(LexState.java:2273) at luaj.compiler.LexState.statlist(LexState.java:2290) at luaj.compiler.LexState.mainfunc(LexState.java:2306) at luaj.compiler.LuaC$CompileState.luaY_parser(LuaC.java:121) at luaj.compiler.LuaC.compile(LuaC.java:99) at luaj.Globals.compilePrototype(Globals.java:364) at luaj.Globals.loadPrototype(Globals.java:352) at luaj.Globals.load(Globals.java:267) at luaj.Globals.loadfile(Globals.java:249) ... 2 more
Administrators Enyby Posted February 28, 2020 Administrators Posted February 28, 2020 run and show output: 1 List = gg.getRangesList() print(List[1]) 2 List = gg.getRangesList() print(List)
qq245267997 Posted February 28, 2020 Author Posted February 28, 2020 34 minutes ago, Enyby said: run and show output: 1 List = gg.getRangesList() print(List[1]) 2 List = gg.getRangesList() print(List) 1 脚本已结束:: { -- table(7badb4c) ['end'] = 3011375104, ['internalName'] = '/system/lib/libc++.so', ['name'] = '/system/lib/libc++.so', ['start'] = 3010412544, ['state'] = 'Xs', ['type'] = 'r-xp', } 2 脚本已结束:: { -- table(18b6ff2) [1] = { -- table(ba69643) ['end'] = 3011375104, ['internalName'] = '/system/lib/libc++.so', ['name'] = '/system/lib/libc++.so', ['start'] = 3010412544, ['state'] = 'Xs', ['type'] = 'r-xp', }, [2] = { -- table(28894c0) ['end'] = 3011395584, ['internalName'] = '/system/lib/libc++.so', ['name'] = '/system/lib/libc++.so', ['start'] = 3011379200, ['state'] = 'O', ['type'] = 'r--p', }, [3] = { -- table(dfa05f9) ['end'] = 3011399680, ['internalName'] = '/system/lib/libc++.so', ['name'] = '/system/lib/libc++.so', ['start'] = 3011395584, ['state'] = 'O', ['type'] = 'rw-p', }, [4] = { -- table(8dc993e) ['end'] = 3011403776, ['internalName'] = '/system/lib/libc++.so:bss', ['name'] = '[anon:.bss]', ['start'] = 3011399680, ['state'] = 'O', ['type'] = 'rw-p', }, } I want to get the Value of List[1].end. but it apear some bugs/error. List = gg.getRangesList() gg.alert(List[1].end)
Administrators Enyby Posted February 28, 2020 Administrators Posted February 28, 2020 end is keyword. You can not use dot notation. Use index notation: Table['end']
qq245267997 Posted February 29, 2020 Author Posted February 29, 2020 8 hours ago, Enyby said: end is keyword. You can not use dot notation. Use index notation: Table['end'] the problem is solved.thx 4 your help.
Question
qq245267997
i use getRangesList() and Returns A list table with memory regions. Each element is a table with fields: state, start, end, type, name, internalName.
like temp = getRangesList();
when i get temp[1].end value , it will appear error. the name cant be 'end'
6 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.