SET TRACEMODE
Sets Mode of Tracing
This directive sets the mode of tracing during a SETTRACE.
Syntax
Section titled “Syntax”SET TRACEMODE string [,ERR=line-ref|,ERC=error-code]string- is either "FULL", "PARTIAL", "SKIPCALLS", "SKIPGOSUBS", or "DELAY=n".
line-ref- is the program line number or label to branch to if this directive produces an error.
error-code- is a programmer-defined error code. Valid values are positive or negative whole numbers.
Remarks
Section titled “Remarks”This directive is generally available starting with release level 8.2.
TRACEMODE is initially in “FULL” mode, printing each line as it is executed.
Doing a SET TRACEMODE “PARTIAL” prints each directive as it is executed.
Starting with Thoroughbred Basic 8.3.0, the “SKIPCALLS” option enables you to skip tracing CALLed routines. Those routines will be executed but you will remain in the main body of the program.
Starting with Thoroughbred Basic 8.3.0, the “SKIPGOSUBS” option enables you to skip tracing GOSUB routines. Those routines will be executed but you will remain in the main body of the program.
DELAY=n, where n is an integer, specifies the number of seconds between displaying trace lines during a SET TRACE in “PARTIAL” mode.
Starting with Thoroughbred Basic 8.8.1, SET TRACEMODE “SHOWNAME” enables you to include the current program name in trace output.
Starting with Thoroughbred Basic 8.8.1, SET TRACEMODE “SKIPTRIGGERS” enables you to skip tracing for 3GL Trigger execution.
Starting with Thoroughbred Basic 8.8.1, SET TRACEMODE “NEVEREND” disables the ENDTRACE directive.
Starting with Thoroughbred Basic 8.8.1, SET TRACEMODE “CLEARFILE” enables you to truncate the file currently opened on the channel when using SETTRACE (channel). This allows tracing from a specific point or condition. This option may be used alone or with other options. This option is ignored for channel 0 unless FILE= has been specified.
Starting with Thoroughbred Basic 8.8.1 SET TRACEMODE “FILE=Filename” appends trace output to channel 0 to the specified Filename file. SETTRACE to other channels is not affected. Filename must include a complete path and is not enclosed in quotes. This option is ignored if file name does not exist.
From Thoroughbred Basic Console Mode, you can use STM as an abbreviation for SET TRACEMODE, followed by “F” for “FULL”, “P” for “PARTIAL”, “SC” for “SKIPCALLS”, “SG” for “SKIPGOSUBS”, or “D=n” for “DELAY=n”. Modes can also be concatenated using the pipe symbol (vertical bar). For example, to use SET TRACEMODE “PARTIAL” to ignore all CALLed programs, and specify a three-second delay between display of each trace line, you can enter STM “P|SC|D=3”.
Starting in Thoroughbred Basic 8.8.1 you can use the following abbreviations: “SN” for “SHOWNAME”, “ST” for “SKIPTRIGGERS”, “NE” for “NEVEREND”, “CF” for “CLEARFILE”, and “F=Filename” for “FILE=Filename”.
The argument for SET TRACEMODE is a string so that further, yet unspecified, options can be added.
Examples
Section titled “Examples”00100 DIM A[2]; FOR I=0 TO 2; LET A[I]=I; NEXT IIn “FULL” (regular) mode, a SETTRACE just prints this line once for each iteration of the FOR/NEXT loop. However, in “PARTIAL” mode, the output is as follows:
-->00100 DIM A[2]-->00100 FOR I=0 TO 2-->00100 LET A[I]=I-->00100 NEXT I-->00100 LET A[I]=I-->00100 NEXT I-->00100 LET A[I]=I-->00100 NEXT ISee also
Section titled “See also”SETTRACE directive
TRACEMODE system variable
From the Thoroughbred Basic Language Reference, Volume III: R–Z, version 8.9.1. Open this page in the PDF