lua-users home
lua-l archive

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


On 10 Apr 2013, at 07:52, Satz Klauer wrote:

> The documentation tells me
> in case of an error some error information are placed on the stack. So
> I guess I have to remove them - but how much data have to be removed
> from stack?

I think the manual is pretty clear on this, it's a single value.

From 5.2 manual:

Both nargs and nresults have the same meaning as in lua_call. If there are no errors during the call, lua_pcall behaves exactly like lua_call. However, if there is any error, lua_pcall catches it, pushes a single value on the stack (the error message), and returns an error code. Like lua_call,lua_pcall always removes the function and its arguments from the stack.

Kev