lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Jul 16, 2010 at 1:27 AM, Matthieu CARON <matbbox@hotmail.fr> wrote:
> Everything works fine when my fonction has less than 250 arguments but I
> receive an error for more arguments.
> The Lua error I receive for more than 250 arguments is [string
> "LuaFunction("arg1","arg2","arg3..."]:1: function or expression too complex
> near 'arg250'

You might want to just pass a table of the arguments, instead of all
of the arguments directly.

----
LuaFunction({"arg1", "arg2", "arg3", ....})
----

It's valid to leave the parentheses off when the only parameter is a
table, so you can also do this:

----
LuaFunction{"arg1", "arg2", "arg3", ....}
----

Then you'll get a table as your single parameter, and you can iterate
over that table to get all of the arguments. Unlike the parameter
list, a table isn't limited to 256 entries.

~Jonathan