Contents Previous Next Subchapters

Switching Between Mlmode And O-Matrix Mode
Syntax mlmode
omatrix
mlmode file_name
omatrix file_name

Mlmode
The mlmode command switches the current input language to be compatible with version 4 of Mlmode. The omatrix command sets the current input language to be O-Matrix. These commands cannot appear inside of a block .

If at the O> prompt you enter
     2 .* 2
O-Matrix will respond with an error message. If on the other hand you enter
     mlmode
     2 .* 2
O-Matrix will respond
     4
because .* is the element-by-element multiplication operator in Mlmode.

OMatrix
The omatrix command switches the current input language to O-Matrix. If you continue the example above by entering
     omatrix
The input language will switch back to O-Matrix.

Symbols
Except for intrinsic and Mlmode intrinsic functions, symbols have the same meaning in both languages. If you enter
     omatrix
     x = 5
     function f(y) begin
          return 2 * y
     end
     mlmode
     x
O-Matrix will reply
     5
If you continue by entering
     f(x)
O-Matrix will reply
     10

File Name
The omatrix file_name and mlmode file_name commands specify language mode to use for processing a certain file. After the file is processed, the language mode is restored to its value before the command. The directory search order for these commands is that same as for the include command.

OMatrix
If you are in Mlmode, and you execute an omatrix file_name command, the corresponding file is included in O-Matrix mode and then control is automatically returned to Mlmode. Note that the O-Matrix search path is used to search for the file.

The rowsum function is not automatically included in Mlmode. If you enter
     clear
     mlmode
     rowsum( 1 : 3 )
O-Matrix will reply with an error message. If you continue by entering
     omatrix rowsum.oms
     rowsum( 1 : 3 )
O-Matrix will reply
     6

Mlmode
If you are in O-Matrix mode, and you execute a mlmode file_name command, the corresponding file is included in O-Matrix mode and then control is automatically returned to Mlmode. Note that the Mlmode search path is used to search for the file.

The int2str function is not automatically included in O-Matrix mode. If you enter
     clear
     omatrix
     int2str( 3.2 )
O-Matrix will reply with an error message. If you continue by entering
     mlmode int2str.m
     int2str( 3.2 )
O-Matrix will reply
     3