Trace: Difference between revisions
(→Syntax) |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 15: | Line 15: | ||
===Syntax=== | ===Syntax=== | ||
TRACE [{ON|OFF|PRINT}] | |||
[[Image:Trace.png]] | [[Image:Trace.png]] | ||
Line 22: | Line 23: | ||
===Parameters=== | ===Parameters=== | ||
"ON" initiates TRACE mode; it starts a display of line numbers on the screen. | "ON" initiates TRACE mode; it starts a display of line numbers on the screen. | ||
"OFF" cancels the display of line numbers. | "OFF" cancels the display of line numbers. | ||
"PRINT" directs TRACE output to the printer. | "PRINT" directs TRACE output to the printer. | ||
===Technical Considerations=== | ===Technical Considerations=== | ||
:1.) Trace mode may also be initiated, terminated, and directed to the printer with options on the [[run]] command and the [[go]] command. | :1.) [[Trace mode]] may also be initiated, terminated, and directed to the printer with options on the [[run]] command and the [[go]] command. | ||
RUN TRACE | |||
===Additional=== | ===Additional=== |
Latest revision as of 14:47, 29 April 2014
The Trace (T) statement displays the line number of each statement in a program as it is being executed.
Comments and Examples
For debugging purposes, it is often helpful to have information about which lines are being executed and in which order. At a point where trouble is anticipated in a program, the programmer can insert the statement
01230 TRACE ON
To start the display of line numbers. Later, the following statement can cancel this feature:
01400 TRACE OFF
The TRACE display runs swiftly and is quickly lost from the screen. The following example will send TRACE output to the printer:
01240 TRACE PRINT
Syntax
TRACE [{ON|OFF|PRINT}]
Default
- 1.) ON.
Parameters
"ON" initiates TRACE mode; it starts a display of line numbers on the screen.
"OFF" cancels the display of line numbers.
"PRINT" directs TRACE output to the printer.
Technical Considerations
- 1.) Trace mode may also be initiated, terminated, and directed to the printer with options on the run command and the go command.
RUN TRACE
Additional
To redirect the output to a file you can use a command similar to:
run trace print >trace.txt
Unfortuantely this can not currently be done with the go command.