关于lua5.2中table.getn方法不能用的代替方案
来源:互联网 发布:战争程序员白濑第二季 编辑:程序博客网 时间:2024/04/29 07:33
lua5.0以上版本去除了table.getn方法,代替方案为
if string.find(_VERSION, "5.2") then
table.getn = function (t)
if t.n then
return t.n
else
local n = 0
for i in pairs(t) do
if type(i) == "number" then
n = math.max(n, i)
end
end
return n
end
end
end
代码放置需要使用table.getn的前边即可
0 0
- 关于lua5.2中table.getn方法不能用的代替方案
- 关于lua table.getn()和#
- lua5.2中对table.insert的区别
- lua的table长度问题(table.getn)
- Lua table中getn与setn
- table.getn(tableName) 的用法注意。
- LUA中的Table.getn()函数的用法
- lua中的table.getn()的一些注意事项
- Repeater中不能用ImageButton显示图片用什么来代替最好我的个人建议
- 关于IE中getElementsByClassName不能用的问题
- 关于Android studio中httpclient不能用的问题
- Lua table.getn() 用法
- Lua table.getn()
- Lua table.getn() 用法
- PreparedStatement 不能用?代替表名的原因
- 解决sql中上下左右backspace不能用的方法
- lua的Table.getn在MAC上使用问题
- 关于MVC不能用EasyUI的问题
- 方法的声明和实现
- 人脸检测--AdaBoost
- 手机删除的文件还能恢复吗
- JS 对象机制深剖——Object.prototype 是谁?
- intent用法——显示地图与路径规划
- 关于lua5.2中table.getn方法不能用的代替方案
- poj2243-Knight Moves-水bfs
- 移动webApp大前端(二)
- JAX-WS 开发流程以及示例
- Oracle 中创建角色,并分配给用户
- arcgis api for flex之五、flex对java自定义对象转换详解
- android view滑动助手类OverScroller
- 转自百度 实时操作系统
- INSTALL TINYX+GTK