TRACE
Format:
TRACE (X)
TRACE X
Supported by: COMX BASIC V1.00, Pecom 32 BASIC, Pecom 64 BASIC 1.0 and 4.0, Quest Super BASIC 3.0, 5.0 and 6.0, RCA BASIC3 V1.1, Telmac SBASIC v 24.3
Similar commands: -
If X evaluates to anything other than zero, the "trace" action is turned on. That is, each line that is executed by BASIC will transmit the following to the screen:
TR [line number]
The numbers on the screen are the line-numbers of each statement as it is executed. This enables the user to follow or "trace" the flow of the program, and is especially useful in the debugging stage to ensure that the program is doing what is intended.
If a TRACE statement is executed with X evaluating to zero, the trace will shut off. These statements may be placed anywhere in a BASIC program. A very useful place for a TRACE statement is in an interrupt routine.
Try the following with a BASIC program
TRACE (1): RUN