moonsharp

Moonsharp pairs(…) raises exception “bad argument #1 to 'next' (table expected, got string)”

半城伤御伤魂 提交于 2019-12-11 07:39:30
问题 I don't get the point why this is happening. I am using Moonsharp to run LUA scripts in my application an I created a LUA function IN(v, ...) and I'd like to itterate over the ... parameter with pairs. IN('param1', 'param2', 'param1') -- expected it to return true function IN(v, ...) local args = ... local res = true for i, v in pairs(args) do if valueIn == v then res = true break end end return res end If it gets called I recieve the folowing exception: "MoonSharp.Interpreter