Hello Leo,
I admit "continue" would simplify the code written, but why not use
for i=0,9 do
...
if <continue_condition1> then
...
if <continue_condition2> then
...
end
end
end
Or have I misunderstood your question?
Thursday, December 21, 2006, 3:07:57 PM, you wrote:
LR> Hi All,
LR> Languages like C and C++ have a handy "continue" construct that skips
LR> to a next loop (for, while) iteration. I am looking for an elegant way
LR> to achieve the same behavior in Lua. So far my best shot is using
LR> "break" inside of "repeat ... until true" block, see below
LR> for i=0,9 do
LR> repeat
LR> if i>=3 and i<=7 then break end --exclude i= 3,4,5,6,7
LR> print(i)
LR> until true
LR> end
LR> Is there a more elegant way?
LR> --Leo--
--
Theodor-Iulian Ciobanu
jr Virus Researcher
e-mail: tciobanu@bitdefender.com
-----------------------------------------
Secure your every bit
-----------------------------------------