FOR

language · Also: NEXT

Count a variable from start to end. STEP defaults to 1. Counting down uses a negative STEP. NEXT without a name uses the innermost FOR.

FOR var = start TO end [STEP step] statements NEXT [var]

var - loop variable start - initial value end - final value (inclusive when STEP lands on it) step - increment (optional; default 1; use negative to count down)

Example:

FOR I = 1 TO 3
  PRINT I
NEXT I
FOR I = 5 TO 1 STEP -2
  PRINT I
NEXT I

Source: docs/help/for.txt inmmcore. On the computer, typeHELP FOR.