Show pageDiscussionOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ==== IFTE ==== ---- <callout type="primary" color="" icon="fa fa-book" title="Synopsis"> ---- Execute objects on the stack conditionally </callout> <callout color="green" icon="fa fa-indent" title="Stack Diagram"> ---- ^ __Input Stack__ ^^^ ^ __Output Stack__ ^ | **1** | **O<sub>true</sub>** | **O<sub>false</sub>** | **→** | **[O<sub>true</sub>]<sub>XEQ</sub>** | | **0** | **O<sub>true</sub>** | **O<sub>false</sub>** | **→** | **[O<sub>false</sub>]<sub>XEQ</sub>** | | //Level 3 / Argument 1// | //Level 2 / Argument 2// | //Level 1 / Argument 3// | //→// | //Level 1// | {{page>manual:chapter6:aux:legend&nofooter&noeditbtn&inline}} |**Type**| [[manual:chapter5:basics#functions|Function]] || |**Parallel list processing**| [[manual:chapter5:listproc#group-2commands-that-must-use-dolist-to-parallel-process|Group 2]] || |**Affected by flags**| None || </callout> <callout color="orangered" icon="fa fa-comment" title="Description"> ---- The ''IFTE'' function tests the object on level 3 of the stack: if the test returns ''1'' then it ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''tes the object on level 2, otherwise it ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''tes the object on level 1. ''IFTE'' can be used in symbolic expressions to define piecewise functions. </callout> <callout type="success" icon="true" title="Compatibility"> ---- This command is fully compatible with userRPL. </callout> <callout type="info" icon="true" title="Usage"> ---- <code> 3: 1 2: { 'X' 'Y' 'Z' } 1: 1_m …………………………………………………………………………………… IFTE </code> will result in <code> 1: { 'X' 'Y' 'Z' } …………………………………………………………………………………… </code> </callout> <callout color="darkgray" icon="fa fa-hand-o-right" title="Related Commands"> ---- {{page>manual:chapter6:stack&nofooter&noeditbtn&inline}} </callout> manual/chapter6/stack/cmd_ifte.txt Last modified: 2019/11/17 14:16by jojo1973