Contents Previous Next Subchapters

Multiple Statements in Same Line
Syntax ; ,
See Also Default Printing Of An Expression

Description
In O-Matrix mode, the semicolon can be used to separate statements on the same line while both the comma and semicolon are used for this purpose in Mlmode.

Example
If you enter
     omatrix
     x = 0
     while x < 3 begin
          x = x + 1; x = x + 1
          print "x =", x
     end
O-Matrix will respond
     x = 2
     x = 4
If you continue by entering
     mlmode
     x = 0;
     while x < 3 
          x = x + 1, x = x + 1
     end
O-Matrix will reply
     x = 1
     x = 2
     x = 3
     x = 4
Note that the loop is executed twice and there are two assignments for each execution of the loop. If you enter
     mlmode
     x = 0;
     while x < 3 
          x = x + 1; x = x + 1
     end
O-Matrix will reply
     x = 2
     x = 4
Only the result of the second assignment is printed each time through the loop because the first assignment statement ends in a semicolon.