[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: how to construct sturct object in lua
- From: Sean Conner <sean@...>
- Date: Fri, 8 Mar 2013 18:52:08 -0500
It was thus said that the Great Sean Conner once stated:
>
> If you don't want to return the new table, then do:
>
> lua_pushinteger(L,A.a);
> lua_setfield(L,1,"a");
> lua_pushinteger(L,A.b);
> lua_setfield(L,1,"b");
You need to add one of the two lines for this to work (just noticed a
bug):
lua_pushvalue(L,1);
lua_settop(L,1);
There are other ways to put the passed in table into position for
returning, but these two lines are the quickest.
-spc