math.maxinteger value is nil in Interactive interpreter at zerobrane

318 Views Asked by At

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

1

There are 1 best solutions below

3
On

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.