lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Thu, Jan 14, 2010 at 12:50 AM, pan shizhu <> wrote:
> in a function you can use error() for break, return for continue.


I usually just use a nested repeat:

for i = 1, 10 do repeat
    if i % 3 == 0 then
        break -- continue
    print( i )
until true end -- poetic, uh?

The only problem is when you _do_ want to break the outer loop.