Print debugging statement: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: added a comment in the REXX section header.)
m (→‎{{header|REXX}}: added more information in the REXX section header.)
Line 204: Line 204:
The first number   (for the   '''trace'''   output)   is the line number for the REXX program.
The first number   (for the   '''trace'''   output)   is the line number for the REXX program.
<br>Blank lines are not &nbsp; ''traced''.
<br>Blank lines are not &nbsp; ''traced''.

This particular output is from the Regina REXX interpreter.
<lang rexx>/*REXX program to demonstrate debugging (TRACE) information while executing a program*/
<lang rexx>/*REXX program to demonstrate debugging (TRACE) information while executing a program*/
/*────────────────────────────────────────────── (below) the I is for information. */
/*────────────────────────────────────────────── (below) the I is for information. */
Line 211: Line 213:
say 'maximum random divisor is:' maxDiv /*display the max divisor being used. */
say 'maximum random divisor is:' maxDiv /*display the max divisor being used. */
total= 0
total= 0

do j=1 to 100
do j=1 to 100
total= total + j/random(maxDiv)
total= total + j/random(maxDiv)
Line 236: Line 239:
7 *-* total= 0
7 *-* total= 0
>L> "0"
>L> "0"
8 *-* do j=1 to 100
9 *-* do j=1 to 100
>L> "1"
>L> "1"
>L> "100"
>L> "100"
>V> "1"
>V> "1"
9 *-* total= total + j/random(maxDiv)
10 *-* total= total + j/random(maxDiv)
>V> "0"
>V> "0"
>V> "1"
>V> "1"
>V> "9"
>V> "9"
>F> "8"
>F> "6"
>O> "0.125"
>O> "0.166666667"
>O> "0.125"
>O> "0.166666667"
10 *-* end /*j*/
11 *-* end /*j*/
8 *-* do j=1 to 100
9 *-* do j=1 to 100
>V> "1"
>V> "1"
>V> "2"
>V> "2"
9 *-* total= total + j/random(maxDiv)
10 *-* total= total + j/random(maxDiv)
>V> "0.125"
>V> "0.166666667"
>V> "2"
>V> "2"
>V> "9"
>V> "9"
>F> "6"
>F> "8"
>O> "0.333333333"
>O> "0.25"
>O> "0.458333333"
>O> "0.416666667"
10 *-* end /*j*/
11 *-* end /*j*/
8 *-* do j=1 to 100
9 *-* do j=1 to 100
>V> "2"
>V> "2"
>V> "3"
>V> "3"
9 *-* total= total + j/random(maxDiv)
10 *-* total= total + j/random(maxDiv)
>V> "0.458333333"
>V> "0.416666667"
>V> "3"
>V> "3"
>V> "9"
>V> "9"
>F> "0"
>F> "0"
9 +++ total= total + j/random(maxDiv)
10 +++ total= total + j/random(maxDiv)
Error 42 running "c:\debuggin.rex", line 9: Arithmetic overflow/underflow
Error 42 running "c:\debuggin.rex", line 10: Arithmetic overflow/underflow
Error 42.3: Arithmetic overflow; divisor must not be zero
Error 42.3: Arithmetic overflow; divisor must not be zero
</pre>
</pre>