In Lua 5.2 the best workaround is to use goto:
-- prints odd numbers in [|1,10|] for i=1,10 do if i % 2 == 0 then goto continue end print(i) ::continue:: end
This is supported in LuaJIT since version 2.0.1
Related Posts:
- What is the difference between range and xrange functions in Python 2.X?
- what does +=, -=, *= and /= stand for in Python?
- How to iterate over a JavaScript object?
- Traverse a list in reverse order in Python
- While Loop in Mips (New to Mips)
- When to use “while” or “for” in Python
- While, Do While, For loops in Assembly Language (emu8086)
- Angular 2 Cannot find control with unspecified name attribute on formArrays
- python “TypeError: ‘numpy.float64’ object cannot be interpreted as an integer”
- Guess a number program with Java
- What is the best way of determining a loop invariant?
- How to iterate through table in Lua?
- How do you write code to do factorials in MIPS?
- Printing from a declared array in MIPS
- Lua operators, why isn’t +=, -= and so on defined?
- For-each over an array in JavaScript
- Python – TypeError: ‘int’ object is not iterable
- Logitech/LGHUB Lua – Loop with break
- Why there is no do while loop in python
- Python – TypeError: ‘int’ object is not iterable
- Loop through an array in JavaScript
- Accessing the index in ‘for’ loops?
- Accessing the index in ‘for’ loops?
- Good input validation loop using cin – C++
- How to avoid “RuntimeError: dictionary changed size during iteration” error?
- How to avoid “RuntimeError: dictionary changed size during iteration” error?
- Loop through an array php
- Iterate through a HashMap [duplicate]
- Loop through an array of strings in Bash?
- Iterate through a HashMap [duplicate]
- foreach vs someList.ForEach(){}
- How do I loop through or enumerate a JavaScript object?
- Why is using “for…in” for array iteration a bad idea?
- Subplot for seaborn boxplot
- Concatenation of strings in Lua
- What is the best way to iterate over a dictionary?
- Split a string using string.gmatch() in Lua
- How do I apply the for-each loop to every character in a String?
- Lua replacement for the % operator
- Correct way of looping through C++ arrays
- Java compressing Strings
- Inline conditions in Lua (a == b ? “yes” : “no”)?
- Lua string.format options
- Batch script loop
- Emulating a do-while loop in Bash
- How to remove a lua table entry by its key?
- Exit while loop in Python
- What condition does while(true) test? When is it true and false?
- Fill array with random numbers within a specified range (C++)
- Pythonic way to iterate through a range starting at 1
- What is a good game engine that uses Lua?
- illegal use of break statement; javascript
- What is Innermost loop in imperfectly nested loops?
- Loop backwards using indices in Python?
- Why does using from __future__ import print_function breaks Python2-style print?
- How can I loop through all rows of a table? (MySQL)
- Why doesn’t Python have a sign function?
- “attempt to index a nil value”-error in Lua
- Creating a timer using Lua
- Bubble sort algorithm in MIPS
- Breaking out of nested loops
- Is there a “do … until” in Python?
- How to add a “sleep” or “wait” to my Lua Script?
- extended initializer lists only available with
- error: ‘for’ loop initial declarations are only allowed in C99 mode [duplicate]
- How to break out of jQuery each loop?
- How to get number of entries in a Lua table?
- How to dump a table to console?
- Lua – if statement with two conditions on the same variable?
- MySQL foreach loop
- Lua string to int
- Iterating over a 2 dimensional python list [duplicate]
- Infinite for loops possible in Python?
- python: restarting a loop
- Iterator Loop vs index loop
- how to loop through JSON array in jQuery?
- Getting input from the user in Lua
- Does Lua have OR comparisons?
- Lua – Number to string behaviour
- Create a two dimensional string array anArray[2][2]
- Why is there no multiple inheritance in Java, but implementing multiple interfaces is allowed?
- How to use a Do-while loop that continuously prompts a user?
- Lua String replace
- What is the “right” way to iterate through an array in Ruby?
- How do I break out of nested loops in Java?
- do-while loop in R
- PHP array printing using a loop
- How to make music autoplay and loop in background
- Get a Try statement to loop around until correct value obtained
- Lua: Rounding numbers and then truncate
- How to loop over something a specified number of times in JSTL?
- How to math.floor to a decimal in Lua?
- How do I append to a table in Lua
- How to make a Java Main Menu Loop after using a case
- Python: Continuing to next iteration in outer loop
- Difference between “while” loop and “do while” loop
- Lua Semicolon Conventions
- how to stop a loop arduino
- How to enumerate an enum