Post Reply 
Getting usable numbers from a Program Preferrably on Stack
05-16-2021, 06:33 AM (This post was last modified: 05-16-2021 06:36 AM by Stevetuc.)
Post: #4
RE: Getting usable numbers from a Program Preferrably on Stack
(05-15-2021 04:02 PM)matalog Wrote:  
(05-15-2021 03:59 PM)Eddie W. Shore Wrote:  The RETURN command can return a list or vector of values to the stack, not just one value.

That's great, I assume that the individual values of the lists will be usable as separate numbers on the stack, so I could go to one of them and press enter, and that single number would be brought to the current calculation line?

Thanks for the reply.

And see this thread. https://www.hpmuseum.org/forum/thread-16946.html

A user defined key can return a string containing multiple values space separated to the command line. Pressing Enter will place those values as separate numbers on the stack.

In the code below, userkey Shift User 2 will place 4 3 2 1 on the RPN command line. Pressing Enter will place the following into Stack levels 1-4

4 (stack 4)
3
2
1 (stack 1)

Code:

KEY K_2()
BEGIN
RETURN "4 3 2 1";
END;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Getting usable numbers from a Program Preferrably on Stack - Stevetuc - 05-16-2021 06:33 AM



User(s) browsing this thread: 1 Guest(s)