Directives
SETTRACE Enable Program Tracing
   
Formats
1. Set Trace, Define File: SETTRACE [(chan)]
2. Trace File String: SETTRACE PRINT strval$ | numval [ ,...]
3. Set Tracing of Windows Host Program: SETTRACE SERVER
4. Trace String to System log: SETTRACE RECORD strval$ | numval [ ,...]

Where:

chan Channel or logical file number of the file to which the trace output will be written.
PRINT Keyword indicating the trace of a file string.
RECORD Keyword indicating the data will be sent to the system error log.
SERVER For internal use only.
strval$ Character string expression to be sent to the trace output.
numval$ Numeric value which will be converted to a string and sent to the trace output.
  The RECORD option is a +PxPlus Exclusive (build 9182.4)
   
Description When you use the SETTRACE directive, ProvideX lists all statements as they are executed until an ENDTRACE is encountered.

The END and STOP directives halt tracing. Tracing is suppressed during the execution of a password-protected program. When tracing, ProvideX lists the statements either to the terminal or to a file (if you designate a channel in a SETTRACE directive). If you use a file, you have to open it first and if it's a serial file, you have to lock it.

It can be confusing if an error occurs in the output/trace file, since the error will be reported as an error for the current statement being traced, which itself may not be in error.

The SETTRACE PRINT produces no output if no trace file or window is active. The SETTRACE RECORD produces no output if no system log exists.



*Note* The ability to pass multiple values to the PRINT and RECORD options is a +PxPlus Exclusive (ver 10). Standard ProvideX only allows a single string to be output.


See Also ENDTRACE End Trace Output.
   
Example 0010 I=3
0020 A=A*A
0030 I=I-1; IF I<>0 THEN GOTO 0020
->SETTRACE
->run
0010 I=3
0020 A=A*A
0030 I=I-1; IF I<>0 THEN GOTO 0020
0020 A=A*A
0030 I=I-1; IF I<>0 THEN GOTO 0020
0020 A=A*A
0030 I=I-1; IF I<>0 THEN GOTO 0020
->endtrace