I like to make some data of my program accessible from Lua like that:
Data[x]["Key"] = Value;
I think this is the same:
Data[x].Key = Value;
I already tried it with the following code:
lua_newtable(l); lua_pushinteger(l, 1); lua_newtable(l); lua_newtable(l); lua_pushstring(l, "k1"); lua_pushstring(l, "v1"); lua_settable(l, -3); lua_newtable(l); lua_pushstring(l, "k2"); lua_pushstring(l, "v2"); lua_settable(l, -3); lua_settable(l, -3); lua_settable(l, -3);
Unfortunately nothing happens when I access the created table from Lua. It seems my Code is not right. What could be the problem? Where is the mistake?
Greetings