[PRIME] RPN: another attempt at returning more than one value to the RPN stack



#2

Here is a somewhat clumsy but seemingly workable solution:

EXPORT temp;

KEY K_Mul()
BEGIN
"i * + 'temp' |> ARG temp ABS"
END;

NB: This is an RPN only solution. Press Shift Help (User) x (Multiply) to start it.

What's missing is an automated ENTER ("\n" doesn't work.)

The need for the global temp variable arises because Ans doesn't work here. Ans is only set when the command line is completely executed.


#3

Does adding RETURN(30); toward the end of the program do anything? Supposedly one can return a key value which then gets processed into the key.


#4

Quote:
Does adding RETURN(30); toward the end of the program do anything? Supposedly one can return a key value which then gets processed into the key.

This will prevent the returning of the string itself. So it's either a string or a key but not both.
#5

I have another idea but it would need some support from HP:

Allow a K_key() function to return a list of items which are fed to the input loop as if they were typed in. This would result in a useful macro facility.

#6

What does the multi app do? Can you give me an example in RPN mode of its use?


#7

Just hit [X] in user mode and the string is returned to the command line. Hitting ENTER executes it, converting the stack levels 1 and 2 to polar coordinates (which is just an example for the technique).


Possibly Related Threads...
Thread Author Replies Views Last Post
  Four-Level RPN and the Real World Matt Agajanian 14 917 12-13-2013, 03:57 PM
Last Post: Manolo Sobrino
  Is Linux common among us RPN types? db (martinez, ca.) 46 1,760 12-11-2013, 08:25 PM
Last Post: Paul Guertin
  [HP Prime] "Error while checking exact value with approximate value, returning both!" Chris Pem10 13 680 12-06-2013, 05:12 AM
Last Post: parisse
  Integration question and "RPN" mode comment Craig Thomas 16 761 12-05-2013, 02:32 AM
Last Post: Nick_S
  HP 50g - select characters on the stack, copy/paste Sean Freeman 7 430 11-20-2013, 07:11 AM
Last Post: Sean Freeman
  Prime: Placing more than 1 item on the RPN stack in a single program? John Colvin 4 298 11-19-2013, 08:59 AM
Last Post: Miguel Toro
  HP-Prime : Extracting elements from a list in RPN Miguel Toro 0 202 11-15-2013, 06:44 PM
Last Post: Miguel Toro
  HP Prime: Recommendation for future RPN Program Mode BruceTTT 3 242 11-13-2013, 10:03 PM
Last Post: BruceTTT
  emu48 - copy stack doesn't work (as expected) Thomas Radtke 2 276 11-11-2013, 02:19 PM
Last Post: Thomas Radtke
  HP Prime Stack operations from within a program John Colvin 1 175 11-08-2013, 09:45 PM
Last Post: Helge Gabert

Forum Jump: