IFTE CMD & IFT new CMD - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: IFTE CMD & IFT new CMD (/thread-7831.html) |
IFTE CMD & IFT new CMD - compsystems - 02-26-2017 03:53 PM HELLO I'm trying to port a code, to replace IF THEN ELSE END, by IFTE 1: in many cases you must enclose the field to true and false between (), when you try it in history view fail PHP Code: ifte( type(expr2) <> DOM_SYMBOLIC , partn:=string(expr2), partn:=conv2RPN3(expr2) ); ok PHP Code: ifte( type(expr2) <> DOM_SYMBOLIC , ( partn:=string(expr2) ), ( partn:=conv2RPN3(expr2) ) ); Original Code PHP Code: #pragma mode( separator(.,;) integer(h32) ) PHP Code: // convToRPN3(x^3); 2: A new IFT command is required, on a future firmware The field for the false condition, I put an empty string, but this is rubbish and when running in the history view it looks bad PHP Code: ifte( partJ > 1 , ( rpnStr:=rpnStr + " " ), "" ); -> PHP Code: ift( partJ > 1 , ( rpnStr:=rpnStr + " " ) ); 3: Now if the field of true or false have more than one statement the compiler generates an error, how to solve this?, I try to group sentences between [], but fails =( PHP Code: ifte( type(expr1) <> DOM_SYMBOLIC, [ rpnStr:=string(expr1), return(rpnStr) ], "" ); All of the above for the purpose of running a CAS program step by step, placing each instruction in the history view |