Lua中没有continue,通过另一种方式实现了continue的功能
for var=exp1,exp2 do
while true do
if condition expressions do
break
end
other statements
...
...
break
end
end
本文介绍Lua语言中如何通过特定语法实现类似其他语言中continue的功能。使用双重循环结构,结合break语句达到跳过当前循环迭代的目的。
Lua中没有continue,通过另一种方式实现了continue的功能
for var=exp1,exp2 do
while true do
if condition expressions do
break
end
other statements
...
...
break
end
end

被折叠的 条评论
为什么被折叠?