[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Help
- From: "Jerome Vuarand" <jerome.vuarand@...>
- Date: Thu, 6 Jul 2006 10:39:46 -0400
In lua I assume your C++ method is bound to something like
XX:GetList() :
-- Just use table constructor to put all your elements in a
table
local elements = { XX:GetList() }
-- Iterate on it to access your
elements
for key,val = ipairs(elements) do
local i = val
print(i)
end
Hello,I meet a
question:
In C++ Use luaWrapper:
int XX::GetList(lua_State*
L)
{
int nCount(0);
for( int i = 1; i < MAX_NUM; ++i)
{
if(m_array[i] == TRUE)
{
lua_pushnumber(L,
i)
++nCount;
}
}
return nCount;
}
In lua, How Can I Get This List
Elements?
thank!
发件人: Brian
Weed
发送时间:
2006-07-03 23:43:43
收件人: Lua
list
抄送:
主题: no calling
environment
After recently upgrading to Lua v5.1.1,
I am now getting an error when
trying to call luaopen_io (previously
known as lua_iolibopen):
luaopen_io- >lua_replace- >lua_G_runerror
lapi.c line 203:
/* explicit test for incompatible code
*/
if (...)
luaG_runerror(L, "no calling
environment")
Can someone tell me why one would
get this error? I'm not messing
with
environments (not on purpose, anyway).
Brian