lua-users home
lua-l archive

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

Thank you! The code is very much appreciated! This is exactly what I needed.


> From: Malte Thiesen <>
> Hi,
> I use the following code to create nested tables. The function takes a
> Lua-state and a string like "very.deeply.nested" and then creates all
> the subtables down to "nested" and leaves the "deepest" table on the stack.
> It also makes sure that the tables aren't overwritten, so if you create
> "very.deeply.nested" and "very.deeply" already exists only "nested" is
> created. Unlike you I use std::string not C-strings so you may have to
> adapt the code a little.
> bool CreateNestedTable(lua_State * L, const std::string & TableName)
> {