System Function TRACE: Difference between revisions

From NARS2000
Jump to navigationJump to search
(Created page with "<h1>Quad Trace - '''⎕TRACE'''     (System Function)</h1> ==Monadic Function — Query TRACE Property== <table border="1" cellpadding="5" cellspacing="0" rule...")
 
No edit summary
Line 28: Line 28:
<p>For example:</p>
<p>For example:</p>


<p><apll>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕TRACE 'f'<br />
<apll><pre>
0 1 2 3<br />
      ⎕TRACE 'f'
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕TRACE '#DydDotDot'<br />
0 1 2 3
0 2</apll></p>
      ⎕TRACE '#DydDotDot'
 
0 2</pre></apll>
 




Line 66: Line 65:
<p>For example:</p>
<p>For example:</p>


<p><apll>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕←0 1 2 3 ⎕TRACE 'f'<br />
<apll><pre>
0 1 2 3<br />
      ⎕←0 1 2 3 ⎕TRACE 'f
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕←0 2 3 4 5 6 7 8 9 ⎕TRACE '#DydDotDot'<br />
0 1 2 3
0 1 2 3 4 5</apll></p>
      ⎕←0 2 3 4 5 6 7 8 9 ⎕TRACE '#DydDotDot'
0 1 2 3 4 5</pre></apll>

Revision as of 23:42, 15 April 2018

Quad Trace - ⎕TRACE     (System Function)

Monadic Function — Query TRACE Property

Z←⎕TRACE R queries the TRACE property of the function named in R, and returns a numeric vector of line numbers in Z.
R is a character scalar or vector name of a user-defined function/operator, anonymous function, or Magic Function.
Z is a numeric vector of line numbers where the function named in R traces the result of each statement on the corresponding line when encountered. A value of 0 in the result means that execution is traced just prior to leaving the function, displaying the function name, line number 0, and the result (if any).


For example:

      ⎕TRACE 'f'
0 1 2 3
      ⎕TRACE '#DydDotDot'
0 2


Dyadic Function — Set TRACE Property

Z←L ⎕TRACE R sets the TRACE property of the function named in R for the line numbers in L, and returns a numeric vector of line numbers in Z.
R is a character scalar or vector name of a user-defined function/operator, anonymous function, or Magic Function.
L is a numeric vector of line numbers in the named function where the result of each statement on the line is traced when the corresponding line number is encountered. If L is an empty vector, the TRACE property of the named function is removed from all line numbers. If a number in L does not correspond to a line number in the named function, that number is ignored.
Z is a numeric vector subset of L where the named function traces the result of each statement on the corresponding line when encountered. The values in the result are in ascending order. A value of 0 in the result means that the result of the named function is traced just prior to leaving the function. The Display property of the result is OFF, meaning that the result does not display unless explicitly forced such as with ⎕←.


For example:

      ⎕←0 1 2 3 ⎕TRACE 'f
0 1 2 3
      ⎕←0 2 3 4 5 6 7 8 9 ⎕TRACE '#DydDotDot'
0 1 2 3 4 5