lua-users home
lua-l archive

Variable number of return values from C to lua

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


Hello,
I have a C function that returns a variable number of values to a LUA function :
int getBones(lua_State* l)
{
 for (int i=0; i<bonesOut.getSize(); i++)
 {
 lua_pushnumber(l, (int)bonesOut[i]);
 }
 return bonesOut.getSize();
}
The LUA function does not know the number of values that are returned
How can i get the values and store them in a simple LUA table ?
Thanks

AltStyle によって変換されたページ (->オリジナル) /