Contents Previous Next Subchapters

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

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

Example
If you enter
x = 5
function f(x) begin
     execmat("print x")
end
f(10)
O-Matrix will respond
     5
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.

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