For

Mon 01 January 2018

Syntax

For count = expression1 To expression2 [Step i]
   statement_list
End-For

Description

Use the For loop to cause the statements of the statement_list to be repeated until count is equal to expression2 . Step specifies the value by which count will be incremented each iteration of the loop. If you do not include Step, count is incremented by 1 (or -1 if the start value is greater than the end value.) Any statement types are allowed in the loop, including other loops.

A Break statement inside the loop causes execution to continue with whatever follows the loop. If the Break occurs in a nested loop, the Break does not apply to the outside loop.