lua continue

for i = 1,10 do
  repeat
    if i == 5 then
		break
	end
    print(i)
  until true
end
print("----------------------------------")
function foo(i, max)
  if i == 5 then
    return foo(6, max) -- continue to i=6
  end
  print(i)
  if i == max then
    return
  else
    return foo(i+1, max)
  end
end

foo(1, 10)

  

posted @ 2013-02-26 15:43  byfei  阅读(248)  评论(0编辑  收藏  举报