lua-users home
lua-l archive

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

Good day!

How can I modify a referenced data? For instance:

// create a table
lua_newtable( L );
// set table[0] = number
lua_pushnumber( L, number );
lua_rawseti( L, -2, 0 );
// reference the table
int ref = lua_ref( L, lock );

// ... somewhere later in the code
// get referenced table
lua_getref( L, ref );

now I can read table[0], but how could I change the value of table[0]
such as next time I do lua_getref( L, ref ) I will get modified table?

Best regards,