Contents Previous Next Subchapters

Delayed Execution of Commands in a Matrix
Syntax execmat(mat)
See Also eval , execfile

Executes the commands in the character matrix mat outside of the context of the current file and function. (the eval function can be used to execute commands inside the context of the current file and function.)

If you enter
x = 5
function f(x) begin
     execmat("print x")
O-Matrix will respond
even though inside the function f the variable x has the value 10. This is because the command print x is executed in the context of the main program.

The commands are written to a temporary file and then the execfile function is used to execute that file. If an error occurs while executing the commands, the temporary file will be used to reference and display the error message.