HP Forums
[PRIME] RPN: another attempt at returning more than one value to the RPN stack - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: [PRIME] RPN: another attempt at returning more than one value to the RPN stack (/thread-254677.html)



[PRIME] RPN: another attempt at returning more than one value to the RPN stack - Marcus von Cube, Germany - 11-03-2013

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.




Re: [PRIME] RPN: another attempt at returning more than one value to the RPN stack - Han - 11-03-2013

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.


Re: [PRIME] RPN: another attempt at returning more than one value to the RPN stack - Marcus von Cube, Germany - 11-03-2013

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.


Re: [PRIME] RPN: another attempt at returning more than one value to the RPN stack - Marcus von Cube, Germany - 11-04-2013

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.


Re: [PRIME] RPN: another attempt at returning more than one value to the RPN stack - BruceTTT - 11-04-2013

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


Re: [PRIME] RPN: another attempt at returning more than one value to the RPN stack - Marcus von Cube, Germany - 11-05-2013

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).