HP Forums

Full Version: User Key: Custom Menu
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
You can assign a custom menu to a user key. The program TEMPLATES assigns a list of functions to the templates key (the key to the right of the Toolbox key, key 18 I believe).

When this program is completed, you call the custom menu by pressing [Shift], [Help] (User), [template key].

Choose a function or command. Whatever you choose will be inserted into the entry line. This user key works in program editing as well.

HP Prime Program: TEMPLATES

Note: I do not have a main “TEMPLATES” program block. In terms of making a custom menu like this, it is not necessary.

Code:

// a custom menu
// 2017 EWS

KEY K_Templ()
BEGIN
LOCAL str,lst,cst,ch;
// templates
lst:={"Function.ROOT()",
"Function.AREA()",
"Function.SLOPE()",
"Finance.TvmNbPmt()",
"Finance.TvmIPYR()",
"Finance.TvmPV()",
"Finance.TvmPMT()",
"Finance.TvmFV()"};


// choose list
cst:={"ROOT",
"AREA",
"SLOPE",
"N",
"I%YR",
"PV",
"PMT",
"FV"};

CHOOSE(ch,"Template",cst);

RETURN lst(ch);

END;

Link to original post: http://edspi31415.blogspot.com/2017/11/h...st-of.html
That's awesome!
(11-03-2017 12:43 PM)Eddie W. Shore Wrote: [ -> ]You can assign a custom menu to a user key. The program TEMPLATES assigns a list of functions to the templates key (the key to the right of the Toolbox key, key 18 I believe).

When this program is completed, you call the custom menu by pressing [Shift], [Help] (User), [template key].

Choose a function or command. Whatever you choose will be inserted into the entry line. This user key works in program editing as well.

HP Prime Program: TEMPLATES

Note: I do not have a main “TEMPLATES” program block. In terms of making a custom menu like this, it is not necessary.

Code:

// a custom menu
// 2017 EWS

KEY K_Templ()
BEGIN
LOCAL str,lst,cst,ch;
// templates
lst:={"Function.ROOT()",
"Function.AREA()",
"Function.SLOPE()",
"Finance.TvmNbPmt()",
"Finance.TvmIPYR()",
"Finance.TvmPV()",
"Finance.TvmPMT()",
"Finance.TvmFV()"};


// choose list
cst:={"ROOT",
"AREA",
"SLOPE",
"N",
"I%YR",
"PV",
"PMT",
"FV"};

CHOOSE(ch,"Template",cst);

RETURN lst(ch);

END;

Link to original post: http://edspi31415.blogspot.com/2017/11/h...st-of.html

Bonjour
Excellente idée, merci.

Hello
Great idea, thank you.
Bonjour
Pour le nouveau firmware Je vous propose une amélioration qui permet de quitter sans faire de choix avec 'ESC'


Hello
For the new firmware I propose an improvement that allows you to leave without making a choice with 'ESC'

Code:

// a custom menu
// 2017 EWS

KEY K_Templ()
BEGIN
LOCAL r,str,lst,cst,ch;
// templates
lst:={"Function.ROOT()",
"Function.AREA()",
"Function.SLOPE()",
"Finance.TvmNbPmt()",
"Finance.TvmIPYR()",
"Finance.TvmPV()",
"Finance.TvmPMT()",
"Finance.TvmFV()"};


// choose list
cst:={"ROOT",
"AREA",
"SLOPE",
"N",
"I%YR",
"PV",
"PMT",
"FV"};

r:=CHOOSE(ch,"Template",cst);
IF r THEN
 RETURN lst(ch);
ELSE
 RETURN -1
END;
END;
Nice enhancement.
Note that you need a semicolon after the RETURN -1 in the third last line viz:
Code:

 RETURN -1;
otherwise it is a syntax error.
Reference URL's