level 1
lgg4513
楼主
急急急
robots = { }
--[[
table.insert(robots, {uid = 1})
table.insert(robots, {uid = 2})
table.insert(robots, {uid = 3})
print ("robots size: ", #robots)
--]]
这个在纯lua调试是OK的 但是 在C++ lua_dofile lua文件后 C++调用了lua的接口 该接口调用了上面的代码 提示:
attempt to index global `table' (a nil value)
我确保 robots不是nil的 有输出过
2021年12月24日 03点12分
1
robots = { }
--[[
table.insert(robots, {uid = 1})
table.insert(robots, {uid = 2})
table.insert(robots, {uid = 3})
print ("robots size: ", #robots)
--]]
这个在纯lua调试是OK的 但是 在C++ lua_dofile lua文件后 C++调用了lua的接口 该接口调用了上面的代码 提示:
attempt to index global `table' (a nil value)
我确保 robots不是nil的 有输出过