HP Forums

Full Version: Executing a program directly from a menu
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
(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)
(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?
(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.
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
(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.
I think user mode is the soln...
Reference URL's