在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
pairsReturns three values: the for k,v in pairs(t) do body end will iterate over all key–value pairs of table See function ipairsReturns three values: an iterator function, the table for i,v in ipairs(t) do body end will iterate over the pairs ( 实例一local tabFiles = {"a","b","c",[7]="d",[8]="e"} 输出结果为: 1 a 实例二local tabFiles = {"a","b","c",[3]="d",[4]="e"}for k,v in ipairs(tabFiles) do print(k,v) end for k,v in pairs(tabFiles) do print(k,v) end 结果为: 1 a 实例三local tabFiles = {"a","b","c",[m]="d",[4]="e"} 输出结果为: 1 a 2 b |
请发表评论