1

math.maxinteger value is nil in Interactive interpreter at zerobrane but not nil in Interactive pattern at cmdline.I test it in windows.

周运良
  • 11
  • 1

1 Answers1

0

This is because the internal interpreter is using the same version that is running the IDE itself, which is Lua 5.1 (it's actually LuaJIT, but it's compatible with Lua 5.1), but math.maxinteger is only defined starting from Lua 5.3. If you need to access interpreters of other versions (Lua 5.2 or Lua 5.3), you just need to select a proper interpreter (Project > Lua Interpreter > Lua 5.3) and then start a debugging session on any Lua file (Project > Start Debugging). After that the Remote Console will be executed in the context of Lua 5.3 interpreter.

Paul Kulchenko
  • 25,884
  • 3
  • 38
  • 56
  • I already set the lua Interpreter as lua5.3(Project > Lua Interpreter > Lua 5.3)but still didnt work ,and the new function in lua 5.3:table.move is nil in zeroBrane,it work in lua.exe – 周运良 Jul 12 '20 at 07:33
  • This is the error information and code:table1={1,2,3} table.move(table1,1,#table1,#table1+1) [string "table.move(table1,1,#table1,#table1+1)"]:1: attempt to call field 'move' (a nil value) – 周运良 Jul 12 '20 at 07:48
  • You need to start debugging first. It's not going to work in the `Local console` even when you switch the interpreter, as you still need to start the debugging session to get access to Lua 5.3 interpreter. – Paul Kulchenko Jul 12 '20 at 17:40