Kilowatt Software's
Classic Rexx Tutorial
Language Level 4.00 (TRL-2)

1 Trace instruction

The trace instruction controls trace activities associated with the current procedure.

The trace instruction has the following syntax variations:

1.1 1. trace setting

This establishes setting as the current setting of trace activities.

Observe: you should use quotes to establish an explicit trace setting; i.e. TRACE 'I'. setting can be a symbol or a literal. When it is a symbol, the symbol's value is used as the trace setting. Consider the following:

The trace instruction above is equivalent to trace '4', instead of trace 'I'.

1.2 2. trace [ VALUE ] settingExpression

This establishes the value of settingExpression as the current setting of trace activities. The value keyword can be omitted if settingExpression does not begin with a symbol or literal string -- i.e. it could start with a parenthesis.

1.3 3. trace

When the trace instruction is entered without any additional text, trace activities are reset to default settings:


1.4 Trace settings

The following trace settings are supported:

1.4.1 Interactive trace setting prefix -- '?'

A requested trace setting can begin with a '?' prefix. This toggles the activation of interactive tracing. If interactive tracing was previously inactive it is activated. If interactive tracing was previously active it is deactivated.

Note: the trace setting is saved when procedures are invoked as a subroutine or function. Thus, invoked procedures can alter the trace setting for their procedure context, without affecting the prevailing trace setting of the calling procedure's context.


1.5 Interactive tracing

When interactive tracing is active, execution pauses after each instruction is processed. Trace instructions that are encountered during instruction execution are ignored.

While execution is paused, the interactive trace facility prompts for a continuation response, on the associated execution console. The following responses are supported.

Note: the state of interactive tracing is saved when procedures are invoked as a subroutine or function. Thus, invoked procedures can alter the trace setting for their procedure context, without affecting the prevailing interactive tracing state of the calling procedure's context.


1.6 Trace output format

When an instruction is traced, it is optionally preceded by leading spaces. These spaces indicate the indentation of the instruction within containing instruction groups -- if, do, or select. Each instruction is preceded by its line number within the source file.

Results are enclosed with leading and trailing double-quotes, so that spaces within the values can be clearly identified.

All lines that are displayed have an additional three character prefix. This prefix helps you determine the type of trace information. The following is a description of trace prefixes.

The following prefixes are used when trace intermediates is active.


Kilowatt Software's -- Classic Rexx Tutorial -- Back to top
Click here if you have any comments or questions regarding this tutorial

Last updated on: 22 Jul 2003