Contents Previous Next Subchapters

For Statement (Mlmode)
Syntax for index = expression 
statement list 
O-Matrix Mode for

Each for token begins a block without needing the begin keyword.

Note that when a for is input at the command line, execution will not occur until the corresponding end is entered.

If in Mlmode you enter
     for i = 1 : 3
O-Matrix will reply
Note that the block of statements is executed three times, and the variable i changes each time through the loop.