Closed Sygmei closed 7 years ago
Nested tables are actually tables inside tables, they are not keyed based on the full path. Doing a dot access like that needs to be run 'inside' the lua vm, so you can access it just be executing inside the vm a string of that form as that is what would have to be done anyway.
std::string path = "a.b.c";
kaguya::LuaRef value = luavm.loadstring("return "+path)(); // get
luavm.loadstring(path + "= ...")("newvalue"); // set
What I needed ! Thank you :)
Is there another way to access a subtable ?
I know you can do :
But is it possible to do something like :
?