lua stack size question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

lua stack size question

Erik Hougaard
A quick question:

What the correct way to find out the number of aruments a
function retuns.

This is in C and is when I'm doing a lua_callfunction from C and
wants to pop the returned values of the stack but if i just call
lua_pop and there is no more on the stack a error is generated.

/Erik

Reply | Threaded
Open this post in threaded view
|

Re: lua stack size question

Luiz Henrique de Figueiredo
>From [hidden email] Sat Jun  5 12:42:30 1999
>From: [hidden email]

>What the correct way to find out the number of aruments a
>function retuns.
>
>This is in C and is when I'm doing a lua_callfunction from C and
>wants to pop the returned values of the stack but if i just call
>lua_pop and there is no more on the stack a error is generated.
>

Call lua_getresult until it returns LUA_NOBJECT.
--lhf