lua-users home
lua-l archive

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


lua_newtable(L) creates a table and puts it on the stack. Then you can use
lua_settable to put stuff into it. Pretty sure this is in the
documentation, since I know it and I haven't perused much of the lua code. 

On Mon, 19 Nov 2001 20:52:36 +0100
"Matthias Gall" <matthias@sechsta-sinn.de> wrote:

> > Matthias should be pushing a single value (a table), instead of
multiple
> > individual values and a count.  Or he could push the multiple values
and
> 
> I read 5.10 and 5.11 in the manual several times now, but it seems
there's
> nothing about creating a table from the C API! lua_settable works with a
> "table that resides somewhere in the stack", and requires a key pushed
onto
> the stack - what key (I just want to return a random number of numerical
> values from my C function to the LUA script)? lua_rawseti does not seem
to
> be the right method, without having created a table somehow.
> 
> Greetings,
> Matt
>