Skip to content

Repeat for Range

AutomationDirect edited this page Jan 3, 2020 · 2 revisions

Repeat for Range


Description

Run a set of commands repeatedly by indexing over a range of values. The current index is stored in a variable. The 'start' value, 'stop' value and 'step' value control the range that the 'index' steps through.


Usage

Place an integer values in the 'start', 'stop' and 'step' sockets and connect desired blocks under the 'commands' hook. These blocks will run in order repeatedly for each number in the range determined by the 'start', 'stop' and 'step'. The current index is stored in a variable connected to 'index'. Placing a 'break' block inside the 'commands' will cause the program to exit the current 'Repeat with Index' block.


Notes

  • The 'Repeat for Range' block will allow any numeric values in the 'start', 'stop' and 'step' sockets. If the 'stop' value is never reached, the 'Repeat for Range' block will never complete. Be sure to double check the range described by the 'start', 'stop' and 'step' values before using this block.

Clone this wiki locally