[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Catching and passing multiple values
- From: Chris <coderight@...>
- Date: Thu, 23 Feb 2006 13:05:32 -0500
Oops... Fixed:
static int luaB_unpack (lua_State *L) {
int n, i;
luaL_checktype(L, 1, LUA_TTABLE);
i = luaL_optint(L, 2, 1);
n = luaL_optint(L, 3, luaL_getn(L, 1));
luaL_checkstack(L, n, "table too big to unpack");
for (; i<=n; i++) /* push arg[1...n] */
lua_rawgeti(L, 1, i);
return n;
}
Had to adjust the for-loop there.
--
// Chris