Implements a For…Next loop in a Math worksheet. The section of script included in the loop begins with the For() call and ends with the Next notation. The Next notation directs back to the beginning of the loop.
|Function||Group||Execution||Windows||Embedded||Thin Client||Mobile Access|
For( numInitialValue, numFinalValue, numStep )
- The initial or starting value of the loop.
- The final or ending value of the loop.
- The step or increment value.
This function returns the current value of the loop.
You must partner every For() call with a Next notation, although you may have any number of worksheet rows between them. And as shown in the example below, you must place the Next notation in the Tag Name column of the worksheet.
- The value of numStep is added to the current value of the loop;
- The execution returns to the For() call at the beginning of the loop; and
- The current value of the loop is compared to the value of numFinalValue. If the current value is less than numFinalValue, then the loop is executed again. If the current value is greater than or equal to numFinalValue, then the loop is skipped and execution resumes with the first row after the Next notation.