Contents Previous Next Subchapters

Line By Line Tracing Of Execution
Syntax trace flag
trace 
flagfile
See Also step , next , list
Abbreviation t
Menu Command Debug | Tracing . . .

Description
The value of flag can be on, off, or a decimal number of seconds. If flag is on, O-Matrix will trace execution in the Debugger window. If flag is off, tracing is turned off. If flag is a decimal number, tracing is turned on and slowed so that the time in seconds between printing lines is equal to the decimal number. If file is specified, only statements in that particular file are traced.

Example
If the file TEMP1.OMS in the current working directory contains
     function f(x) begin
          return x
     end
and the file TEMP2.OMS in contains
     x = {1, 2, 3}
     f(x)
and at the O> prompt you enter
     clear
     include TEMP1.OMS
     stop
and then at the DEBUG> prompt enter
     trace on
     quit
and at the O> prompt you enter
     include TEMP2.OMS
O-Matrix will display the following in the Debugger window:
       C:\OMWIN\TEMP2.OMS
          1 x = {1, 2, 3}
          2 f(x)
       C:\OMWIN\TEMP1.OMS
          1 function f(x) begin
          2   return x

Note that O-Matrix prints the filename every time it changes. Also note that a blank line is printed when control returns to the command line.

If you continue this example by entering
     trace on TEMP2.OMS
at the DEBUG> prompt, followed by
     include TEMP2.OMS
at the O> prompt, O-Matrix will respond
          1 x = {1, 2, 3}
          2 f(x)
in the Debugger window. Note that none of the filenames are printed in this case because there is only one file being traced.