lua-users home
lua-l archive

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


Dirk,

how do you want to pick up the value break provided?

--
Oliver

Am 24.11.2014 um 07:39 schrieb Dirk Laurie:
Optional integer constant after "break" specifies number of enclosing
loops to break. `break 1` means the same as `break` without a number.

Example: find an item in a table of lists, with shortcut exit from a list.

for k,a in pairs(t) do
     for n,b in ipairs(a) do
        if futile(b) then break end
        if found(b) then row,col = k,n; break 2; end
    end
end