The Trace function returns the current Rexx trace setting, and optionally alters the trace setting.
result = Trace( [ setting ] ) |
All -- all clauses are traced BEFORE execution
Commands -- all commands are traced before execution. The return code of any commands that complete in error or failure are also traced.
Error -- commands that complete in error or failure are traced after execution, along with the return code.
Failure -- commands that complete in failure are traced after execution, along with the return code.
Intermediates -- all clauses are traced before execution. All terms, intermediate results, and symbolic name substitutions are traced. The final result of any expression is also traced.
Labels -- traces labels that are passed during execution.
Normal -- commands that complete in failure are traced after execution, along with the return code. (Default! Same as: Failure)
Off -- nothing is traced, and interactive tracing is deactivated.
Results -- all clauses are traced before execution. The final result of any expression is also traced.
The setting can be preceded by a question mark character ('?'). This has the effect of toggling the interactive trace facility. If interactive tracing was active, it is deactivated. If interactive tracing was inactive, it is activated.
Trace settings are also adjusted by the trace instruction. The description of the trace instruction further describes the trace facility.
Examples:
say Trace() -- shows: prior trace setting say Trace( 'I' ) -- shows: prior trace setting, activates intermediate tracing say Trace( '?I' ) -- shows: prior trace setting, activates intermediate tracing, toggles interactive tracing. say Trace( 'O' ) -- shows: prior trace setting. Also turns off tracing and interactive trace facility.
|