[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Creating a table through the API
- From: "Darius Blaszijk" <dhkblaszyk@...>
- Date: Sun, 28 Jan 2007 17:57:35 +0100
I'm trying to create a table equivalent to t = {1,2,3,4,5}
Sofar what I've come up with is:
lua_newtable(L);
lua_pushstring(L, PChar('1'));
lua_pushnumber(L, 2);
lua_settable(L, -3);
lua_setglobal(L, PChar('t'));
It should create a table t = {2} but when I print the table contents it
appears to be empty. Can anyone point me where I'm going wrong here?
Kind regards, Darius