Insert and modify loops

Loops repeat selected portions of the script until certain criteria is met or for a specified number of iterations. You can insert loops and loop modifiers from the Flow control section of the Steps box (available by clicking Step in the toolbar).

For loops

For loops perform the steps surrounded by the loop until the end condition is met or the code reaches a break statement. Loops arguments use JavaScript syntax. To insert a for loop, click Step, select Flow Control and drag For Loop to the desired location in the script.

Back to top

Break statements

Break statements indicate that the current loop should end immediately. For example, if a break statement is encountered in the second of five iteration in a for loop, the loop will end immediately without completing the remaining iterations. To insert a break statement, click Step, select Flow Control and drag Break to the desired location in the script.

Back to top

Continue statements

Continue statements indicate that the current loop iteration should end immediately. The loop condition is then checked to see if the entire loop should end as well. For example, if a continue statement is encountered in the second of five iterations in a for loop, the second iteration will end immediately and the third iteration will begin. To insert a continue statement, click Step, select Flow Control and drag Continue to the desired location in the script.

Back to top

See also: