Reference Guide

1-52 RPL Programming
You must acknowledge a message box by pressing
%OK%
or .
Using Menus with Programs
You can use menus with programs for different purposes:
Menu-based input.
A program can set up a menu to get input during a halt in a program and then resume
executing the same program.
Menu-based application.
A program can set up a menu and finish executing, leaving the menu to start
executing other related programs.
To set up a built-in or library menu:
1.
Enter the menu number.
2.
Enter the MENU command (MODES MENU menu).
To set up a custom menu:
1.
Enter a list (with
{ }
delimiters) or the name of a list defining the menu actions. If a list of two element lists is
given, the first element appears in the menu, but it is the second element that is returned to the stack when the
menu key is pressed. This second element can itself be a list with up to 3 objects, one for the menu key, one for the
left shift menu key and one for the right shift menu key.
2.
Activate the menu:
To save the menu as the CST menu, enter the MENU command (MODES MENU menu).
To make the menu temporary, enter the TMENU command (MODES MENU menu).
The menu isn’t displayed until program execution halts.
Menu numbers for built-in menus are listed in Appendix H. Library menus also have numbers — the library
number serves as the menu number. So you can activate applications menus (such as the SOLVE and PLOT
menus) and other menus (such as the VAR and CST menus) in programs. The menus behave just as they do during
normal keyboard operations.
You create a custom menu to cause the behavior you need in your program — see the topics that follow. You can
save the menu as the CST menu, so the user can get it again by pressing . Or you can make it temporary
it remains active (even after execution stops), but only until a new menu is selected — and it doesn’t affect the
contents of variable CST.
To specify a particular page of a menu, enter the number as m.pp, where m is the menu number and pp is the page
number (such as 94.02 for page 2 of the TIME menu). If page pp doesn’t exist, page 1 is displayed (94 gives page 1
of the TIME menu).
Example:
Enter
69 MENU
to get page 1 of the MODES MISC menu.
Enter
69.02 MENU
to get page 2 of the MODES MISC menu.
To restore the previous menu:
Execute 0 MENU.
To recall the menu number for the current menu:
Execute the RCLMENU command (MODES MENU menu).
Using Menus for Input
To display a menu for input in a program:
1.
Set up the menu — see the previous section.
2.
Enter a command sequence that halts execution (such as DISP, PROMPT, or HALT).