lua-users home
lua-l archive

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


On Sat, Jan 22, 2011 at 10:00 AM, Steve Litt <slitt@troubleshooters.com> wrote:
> I'd give my right arm for a continue statement within a loop. I know it's
> lousy programming technique,

This one comes up frequently ;)

E.g.

http://lua-users.org/lists/lua-l/2010-11/msg00479.html

for an interesting generalization.

I think the usu way of doing it is:

while condition do repeat
     if something then break end --- breaks the repeat, acts like continue
     ...
until true; end

Of course, this means that it's hard to actually break out of the while...

steve d.

PS. I wouldn't necessarily think of 'continue' as bad