manual:chapter6:stack:cmd_depth

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:chapter6:stack:cmd_depth [2019/10/18 14:06]
jojo1973 Redone according final template
manual:chapter6:stack:cmd_depth [2021/09/19 13:28] (current)
jojo1973 Redone
Line 1: Line 1:
 ==== DEPTH ==== ==== DEPTH ====
----- 
 <callout type="primary" color="" icon="fa fa-book" title="Synopsis"> <callout type="primary" color="" icon="fa fa-book" title="Synopsis">
 ---- ----
-Returns the number of items present on the stack+Return the number of items present on the stack
 </callout> </callout>
  
 <callout color="green" icon="fa fa-indent" title="Stack Diagram"> <callout color="green" icon="fa fa-indent" title="Stack Diagram">
----- 
 ---- ----
 ^  __Input Stack__  ^  ^  __Output Stack__  ^ ^  __Input Stack__  ^  ^  __Output Stack__  ^
-   |  **→**  |  **I<sub>depth</sub>** + ****  |  **→**  |  **I<sub>depth</sub>** 
-|  //Level 1//  |  ****   //Level 1//  | +|  //Level 1//  |  ////   //Level 1//  |
  
 {{page>manual:chapter6:aux:legend&nofooter&noeditbtn&inline}} {{page>manual:chapter6:aux:legend&nofooter&noeditbtn&inline}}
  
-|**Type**| [[manual:chapter5:basics#operators|Command]]  || +| **Keyword type**  | [[manual:chapter5:basics#commands|Command]]  || 
-|**Parallel list processing**| [[manual:chapter5:listproc#group-1commands-that-cannot-parallel-process|Group 1]]  ||  +| **Parallel list processing capabilities**  | [[manual:chapter5:listproc#group-1commands-that-cannot-parallel-process|Group 1]]  | //Commands that cannot parallel process//  
-|**Affected by flags**| None  ||+| **Affected by flags**  [[manual:appendix:flags#flag-28|-28]]  //Enable RPN stack mode//  | 
 +| ::: | [[manual:appendix:flags#flag-29|-29]]  | //RPN stack depth// 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 </callout> </callout>
  
Line 23: Line 35:
 ---- ----
 The ''DEPTH'' command puts on the level 1 of the stack the number of elements present on it before executing the command itself. The ''DEPTH'' command puts on the level 1 of the stack the number of elements present on it before executing the command itself.
 +
 +When the stack is in RPN mode ''DEPTH'' always returns ''4'' or ''8'', depending on the selected stack depth.
 </callout> </callout>
  
-<callout type="success" icon="true" title="Compatibility">+<callout type="warning" icon="true" title="Compatibility">
 ---- ----
-This command is fully compatible with userRPL.+''DEPTH'' is not fully equivalent to its **userRPL** counterpart. 
 + 
 +In particular: 
 + 
 +  * In **userRPL** RPN stack mode is not supported.
 </callout> </callout>
  
 <callout type="info" icon="true" title="Usage"> <callout type="info" icon="true" title="Usage">
 ---- ----
 +**__Input__**
 <code> <code>
-3:            "This is a string" +4:                                       
-2:               { 'X' 'Y' 'Z'+3:                                   1_m 
-1:                           1_m +2:                       { 'X' 'Y' 'Z'
-…………………………………………………………………………………… +1:                    "This is a string" 
-DEPTH+………………………………………………………………………………………………………… 
 +DEPTH                                   
 </code> </code>
-will result in+\\ 
 +**__Output__**
 <code> <code>
-4:            "This is a string" +4:                                   1_m 
-3:               { 'X' 'Y' 'Z'+3:                       { 'X' 'Y' 'Z'
-2:                           1_m +2:                    "This is a string" 
-1:                             +1:                                     
-…………………………………………………………………………………… +………………………………………………………………………………………………………… 
 +                                        
 </code> </code>
 </callout> </callout>
Line 54: Line 75:
 {{page>manual:chapter6:stack&nofooter&noeditbtn&inline}} {{page>manual:chapter6:stack&nofooter&noeditbtn&inline}}
 </callout> </callout>
 +
  • manual/chapter6/stack/cmd_depth.1571432819.txt.gz
  • Last modified: 2019/10/18 14:06
  • by jojo1973