lua-users home
lua-l archive

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


On Thu, Aug 13, 2009 at 7:59 PM, Imagine Mailing
Lists<mailing_lists@imagine-programming.com> wrote:
> ProcedureC Somefunction(*lua)
>     lua_newtable(*lua)
>     For i=1 to 20
>         lua_pushnumber(*lua, i)
>         lua_pushstring(*lua, "Nodevalue")
>         lua_settable(*lua, -3)
>     next
> EndProcedure
>
> Instead of pushing a string, i'd like to push a table in that index. How
> would I do that? (even the filling must be done in that moment)

lua_newtable() will do the job, again. You then have to fill it in,
using lua_settable, etc.  The main thing is to avoid getting confused
with the stack - drawings seem to help ;)

steve d.