Jump to content
  • 0

Api mistakes in Lua grammar


qq245267997

Question

6 answers to this question

Recommended Posts

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

 

Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.