|
Thanks Rena Rick From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org]
On Behalf Of Rena On Aug 17, 2016 4:37 PM, "Leinen, Rick" <RLeinen@leviton.com> wrote: Whatever method you use to load the script should leave a function on the stack, which you call using lua_call or similar. As described in the manual for those methods, to pass arguments to the function, you push them to the stack (after the function is
already there), and tell lua_call how many arguments you pushed. The called script receives the arguments via the ... operator: C: Lua: (if fewer than 3 arguments were passed - even zero - the remaining items are set to nil. If more than 3 are passed, the extras are discarded. Use select('#', ...) to check how many arguments were passed.) |