'F'or

For loop

Syntax

F reg = startExp T endExp .... N

Description

The moan For loop is a little more restricted than the For loop in TNT Basic in that it has a fixed step of 1 which cannot be changed.

Moan For loops have to use a register as their loop counter because there are no other variables in moan programs. startExp and endExp are normal moan expressions that can be built up from constants, operators and other registers.

For loops can be nested, as with normal TNT Basic operation.

Example:

' Move object horizontally in steps of 20
"F R0 = 0 T 10; L X = R0 * 20; P; N"

See also TNT Basic's For loop and the Advanced Moan Tutorial.

Table of contents