manual:chapter6:stack:cmd_depth

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revision Both sides next revision
manual:chapter6:stack:cmd_depth [2018/03/20 07:45]
claudio created
manual:chapter6:stack:cmd_depth [2019/11/28 14:36]
jojo1973 Added flags -28 and -29
Line 1: Line 1:
 ==== DEPTH ==== ==== DEPTH ====
 ---- ----
-<callout color="black" icon="fa fa-indent" title="Stack Diagram"> +<callout type="primary" color="" icon="fa fa-book" title="Synopsis"> 
-Input Stack ^  ^ Output Stack +---- 
- | → | **I** |+Return the number of items present on the stack 
 +</callout> 
 + 
 +<callout color="green" icon="fa fa-indent" title="Stack Diagram"> 
 +---- 
 + __Input Stack__  ^  ^  __Output Stack__  
 +    ****   **I<sub>depth</sub>**  | 
 +|  //Level 1//  |  //→//  |  //Level 1//  |  
 {{page>manual:chapter6:aux:legend&nofooter&noeditbtn&inline}} {{page>manual:chapter6:aux:legend&nofooter&noeditbtn&inline}}
  
-| **Can be used in symbolics** | No +|**Type**| [[manual:chapter5:basics#commands|Command]]  || 
-| **Affected by flags** | No |+|**Parallel list processing**| [[manual:chapter5:listproc#group-1commands-that-cannot-parallel-process|Group 1]]  ||  
 +|**Affected by flags**|  [[manual:appendix:flags#flag-28|-28]] | RPL / RPN stack mode  | 
 +|:::|  [[manual:appendix:flags#flag-29|-29]] | RPN stack depth  | 
 +</callout>
  
 +<callout color="orangered" icon="fa fa-comment" title="Description">
 ---- ----
-===Description=== +The ''DEPTH'' command puts on the level 1 of the stack the number of elements present on it before executing the command itself. 
-Returns the number of items present on the stack before executing the command.+ 
 +When the stack is in RPN mode ''DEPTH'' always returns ''4'' or ''8'', depending on the selected stack depth. 
 +</callout> 
 + 
 +<callout type="warning" icon="true" title="Compatibility">
 ---- ----
 +This command is only partially compatible with userRPL.
  
 +In particular:
 +  * In userRPL RPN stack mode is not supported.
 </callout> </callout>
-<callout type="success" icon="true"> 
-===Compatibility=== 
-This command is fully compatible with userRPL. 
-</callout> 
-<callout type="info" icon="true" title="Notes and Examples"> 
-The following program: 
  
-  « 123 DEPTH » +<callout type="info" icon="true" title="Usage"> 
-   +---- 
-Will result in a stack containing ''123'' and ''1'' when executed on an empty stack.  +<code> 
 +3:            "This is a string" 
 +2:               { 'X' 'Y' 'Z'
 +1:                           1_m 
 +…………………………………………………………………………………… 
 +DEPTH 
 +</code> 
 +will result in 
 +<code> 
 +4:            "This is string" 
 +3:               'X' 'Y' 'Z
 +2:                           1_m 
 +1:                             3 
 +…………………………………………………………………………………… 
 + 
 +</code>
 </callout> </callout>
-<callout color="black"+ 
-===Related commands===+<callout color="darkgrayicon="fa fa-hand-o-right" title="Related Commands"> 
 +----
 {{page>manual:chapter6:stack&nofooter&noeditbtn&inline}} {{page>manual:chapter6:stack&nofooter&noeditbtn&inline}}
 </callout> </callout>
  • manual/chapter6/stack/cmd_depth.txt
  • Last modified: 2021/09/19 13:28
  • by jojo1973