FOR ... NEXT

Concept Link IconSee also

Repeat a block of instructions a specified number of times in a loop.

WebVue support - Yes.

Syntax

FOR(expression1;expression2; [expression3])

    [block of instructions]

NEXT

There is no return type.

Execution

Expression1 is evaluated when the Execution of the loop starts, to provide the initial state of the loop.

Expression2 is the loop test. The loop will repeat whilst the condition is true.

Expression3 provides the update or increment for the loop.

Example

SUB Main()

'Declare variables

DIM i as Integer;

 

'Integer i increases from 0 to 7 by steps of 2

For (i=0;i<7;i=i+2)

  Print(i);

Next

END SUB