Name
lua_pcall -- run a Lua function in protected mode (V5.0)
Synopsis
int error = lua_pcall(lua_State *L, int nargs, int nrvals, int errfunc);
Function
This function does the same as Lua's lua_pcall() function except that it returns a Hollywood error code if something goes wrong. On success, 0 is returned which is the same behaviour as in Lua's lua_pcall().

Furthermore, the errfunc parameter is not supported and must be 0. The Hollywood version of lua_pcall() also won't push the error message on the stack.

Finally, you should always set HWMCP_SETCALLBACKMODE to True before calling lua_pcall() and reset it to False when lua_pcall() returns. See hw_MasterControl for details.

Note that up to and including Hollywood 6.1 lua_pcall() didn't keep the stack balanced in case an error was returned. This has been fixed for Hollywood 6.2.

Designer compatibility
Unsupported

Inputs
L
pointer to the lua_State
nargs
number of arguments on the stack
nrvals
number of return values
errfunc
unsupported; must be 0
Results
error
Hollywood error code or 0 on success

Show TOC