The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

[PRIME] RPN: another attempt at returning more than one value to the RPN stack
Message #1 Posted by Marcus von Cube, Germany on 3 Nov 2013, 6:54 a.m.

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
Message #2 Posted by Han on 3 Nov 2013, 7:09 a.m.,
in response to message #1 by Marcus von Cube, Germany

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
Message #3 Posted by Marcus von Cube, Germany on 3 Nov 2013, 7:42 a.m.,
in response to message #2 by Han

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
Message #4 Posted by Marcus von Cube, Germany on 4 Nov 2013, 12:01 p.m.,
in response to message #2 by Han

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
Message #5 Posted by BruceTTT on 4 Nov 2013, 11:48 p.m.,
in response to message #1 by Marcus von Cube, Germany

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
Message #6 Posted by Marcus von Cube, Germany on 5 Nov 2013, 2:44 a.m.,
in response to message #5 by BruceTTT

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


[ Return to Index | Top of Index ]

Go back to the main exhibit hall