[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.2 and continue
- From: Romulo <romuloab@...>
- Date: Thu, 14 Jan 2010 11:22:17 -0200
On Thu, Jan 14, 2010 at 12:50 AM, pan shizhu <pan.shizhu@gmail.com> wrote:
> in a function you can use error() for break, return for continue.
Ouch.
I usually just use a nested repeat:
for i = 1, 10 do repeat
if i % 3 == 0 then
break -- continue
end
print( i )
until true end -- poetic, uh?
The only problem is when you _do_ want to break the outer loop.
--rb