Contents Previous Next Subchapters

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

Description
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.

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