Post Reply 
Executing a program directly from a menu
09-01-2017, 12:38 PM
Post: #1
Executing a program directly from a menu
I'm just curious. Currently, to run a program you select it from the user menu and it gets pasted to the input line and then you hit enter to execute it. Is there a way to run a program directly from a menu selection?....so that the program can operate on the input line's contents?
Thx
-D
Find all posts by this user
Quote this message in a reply
09-01-2017, 02:05 PM
Post: #2
RE: Executing a program directly from a menu
(09-01-2017 12:38 PM)webmasterpdx Wrote:  I'm just curious. Currently, to run a program you select it from the user menu and it gets pasted to the input line and then you hit enter to execute it. Is there a way to run a program directly from a menu selection?....so that the program can operate on the input line's contents?
Thx
-D

If your program starts like this:

EXPORT myprog(x)

then to call your program with 5.2 as an example on home screen

in algebraic mode:
myprog(5.2)
<enter>

in RPN mode:
5.2
<Enter>
myprog(1)

Tom L

I told my doctor I have insomnia.
She told me not to lose any sleep over it.
Find all posts by this user
Quote this message in a reply
09-01-2017, 07:47 PM (This post was last modified: 09-01-2017 09:36 PM by Cristóbal De Jesús.)
Post: #3
RE: Executing a program directly from a menu
(09-01-2017 02:05 PM)toml_12953 Wrote:  
(09-01-2017 12:38 PM)webmasterpdx Wrote:  I'm just curious. Currently, to run a program you select it from the user menu and it gets pasted to the input line and then you hit enter to execute it. Is there a way to run a program directly from a menu selection?....so that the program can operate on the input line's contents?
Thx
-D

If your program starts like this:

EXPORT myprog(x)

then to call your program with 5.2 as an example on home screen

in algebraic mode:
myprog(5.2)
<enter>

in RPN mode:
5.2
<Enter>
myprog(1)

I deduct that 1 in myprog(1) is the amount of parameters to get from the stack... Am I right?
Find all posts by this user
Quote this message in a reply
09-01-2017, 09:06 PM
Post: #4
RE: Executing a program directly from a menu
(09-01-2017 07:47 PM)Cristóbal De Jesús Wrote:  I deduct that 1 in myprog(1) is the amount pd parameters to get from the stack... Am I right?

Yes, but this is only needed if the function accepts multiple numbers of arguments. Since user functions currently accept only a fixed number of arguments, that is not necessary and automatic. ENTER will correctly take 1 argument without specifying (1) manually.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
09-02-2017, 03:18 AM
Post: #5
RE: Executing a program directly from a menu
What did you mean by 5.2?
Also, isn't this doing what I was asking to get around? i.e. Pasting to the input line. I wanted to select it from the menu and have it execute immediately, without being pasted (assuming no parameters....it would get it's input data from it's gui or from the current input line or stack).
Thx
-D
Find all posts by this user
Quote this message in a reply
09-02-2017, 10:34 AM
Post: #6
RE: Executing a program directly from a menu
(09-02-2017 03:18 AM)webmasterpdx Wrote:  What did you mean by 5.2?
Also, isn't this doing what I was asking to get around? i.e. Pasting to the input line. I wanted to select it from the menu and have it execute immediately, without being pasted (assuming no parameters....it would get it's input data from it's gui or from the current input line or stack).
Thx
-D

Sorry! I misunderstood the question. The 5.2 is just used as an example parameter. It has no significance.

Tom L

I told my doctor I have insomnia.
She told me not to lose any sleep over it.
Find all posts by this user
Quote this message in a reply
09-02-2017, 07:57 PM
Post: #7
RE: Executing a program directly from a menu
I think user mode is the soln...
Find all posts by this user
Quote this message in a reply
Post Reply 




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