[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: is this valid?
- From: "Roger D. Vargas" <rogerdv@...>
- Date: Tue, 12 Aug 2003 10:53:44 -0400
I want to pass an array of userdata to a lua script, can I do it this way?
In c:
lua_newtable(l);
lua_pushstring(l, "1"); //Index
lua_pushlightuserdata(l,data);
lua_settable(l,-3)
....
lua_setglobal(l, "list");
lua_pushnumber(l,number_of_values);
lua_setglobal(l,"number");
And then in lua script:
for i=1,number do
do something with list[i]....
--
Roger D. Vargas
ICQ: 117641572
Linux user: 180787
* Tanto si piensas que puedes, como si piensas que no puedes, tienes razón *
Henry Ford