Anonymous user
Print debugging statement: Difference between revisions
→{{header|REXX}}: added more wording to the REXX section preamble.
(→{{header|REXX}}: added more wording to the REXX section preamble.) |
|||
Line 363:
=={{header|REXX}}==
<br>way to visually examine the values of any variable throughout the program's execution.
When that might not prove feasible (maybe because of copious output before the problem occurs),
<br>using the '''trace''' instruction might be a better choice.
Some of the options for the '''trace''' instruction are to display:
:* what commands have a non-zero return code
:* result of clauses
:* what commands are being executed
:* the (name of) labels being executed
:* command errors
:* command failures
:* commands executed that have a negative return code
:* an interactive mode that pauses and lets the programmer display values of variables
One of the options that shows the detailed information is the <big>''' ''i'' '''</big> option which
is the most informative and
<br>shows intermediate results within a REXX statement as it's being evaluated.
The first number (for the '''trace''' output) is the line number for the REXX program.
<br>(Blank lines are not ''traced''.)
<lang rexx>/*REXX program to demonstrate debugging (TRACE) information while executing a program*/
/*────────────────────────────────────────────── (below) the I is for information. */
|