FSMenu Documentation
--------------------

By Michael Woodhams

Full screen menu system v1.0

Capsule Review:

Running the program causes the top half of the screen disappears under a
multi-line menu display, and the top rows of the keyboard are
temporarily redefined. Keys can be programmed to return constants, run
built in commands and user programs, behave like a UNIT key or access
another multi-line menu. Once a key has been pressed, the multi-line
display disappears. The contents of the menu can be edited as desired.

History:
 
I wrote version one of this program shortly after I got my HP-48SX,
which would be early 1990. In version one, you had to edit the program
to change the key assignments. I didn't give a name to the program,
but it entered Wayne Scott's mail server as PHYCONST. After this was
posted, somebody (whose name I have now lost, but to whom I am very
grateful) improved it to version 2, which stored the key assignments
in variables and included a program to edit them. Version 3 (by
myself) added multiple menu capability, variable menu size, and much
more error checking. It was probably originally posted a bit over a
year ago.

Instructions:

I will start by giving instructions on how to use the program with the
menus I have provided (which show a strong astrophysical slant.)
Instructions on how to create you own menus come afterwards.

The file UGR contains a grob with 5 rows like the HP soft keys
display, representing the top 5 rows of the keyboard. UVL is a
multi-level list of programs and values telling the calculator what to
do if a given key is pressed. The UMENU program displays the grob,
waits for a keypress, and takes the appropriate action. To run the
program, enter 'UGR' (level 2) and 'UVL' (level 1) on the stack and
execute UMENU. (Note you enter the NAME of the UGR and UVL variables
on the stack as an algebraic, not the actual contents of the
variables.) The most convenient way to do this is to assign the
program

\<< 'UGR' 'UVL' UMENU \>>

to a key. (I use the CST key, and keep my calculator always in USER
mode.)

Once you have run the program, you will see the top 2/3 of the display
get overwritten by the menu grob. If you press any key from the top
two rows (except NXT) the display will disappear, and a constant (such
as the luminosity of the sun) will be put on the stack. The 3rd to 5th
rows of keys (except ENTER and +/-) are units keys and behave just
like they would in the units menus, including shifted functions. (No
more bouncing through units menus to enter W m^-2 Hz^-1 Ster^-1 ! (or
even erg s^-1 cm^-2 Hz^-1 Ster^-1 for cgs-ites.)) NXT displays a three
line menu of less used constants and units. ENTER converts to SI units
(i.e. the UBASE function.) +/- runs a program I wrote to convert to
cgs units. Any other key except shift, alpha, on will abort the
program and leave the stack in pristine condition. (Note: batteries
and cgs conversion program not included.)

There may be a few of you out there who don't require the mass of the
sun or use parsecs often enough to want these crowding their menus.
To design your own menu: Run the UCLEAR program, and tell it how many
rows you want (say, 4) your menu to have. After some pretty pictures,
it will exit with a blank multi-leveled list in level 1 and a grob in
level 2.  Save these in a couple of variables (say 'LST' and 'GRB'.)
Now you can start filling your virgin menu using the UMOD program.

Put the names of the GROB variable in level two, and the name of the
list variable in level one ('GRB' ENTER 'LST' in our example.) and run
UMOD. You will be presented with the multi-line menu, all of which
will be blank at present. Press the button you wish to redefine (say,
the MTH key.) You will be asked for a label for this key. (If you wish
to leave the label unchanged, just hit ENTER. If you give a too long
label, you will be asked again.) In this case, we want to put the gas
constant R=8.317 J mol^-1 K^-1 in the menu, so we give it the label R.
Now we have a list of options according to what we want to assign to
the key. (The options are constant object, library constant, menu, no
change, program name, unit.) We press C for constant object, and type

8.314 _ [UNITS] [NXT] [ENRG] [J] / [UNITS] [MASS] [NXT] [NXT] mol /
[UNITS] [NXT] [TEMP] [K] [ENTER] 

(note the unit menus will only give you the name of the unit. You have
to type the underscore, multiplications and divisions yourself) or
alternatively 

8.314_J/mol/K [ENTER]

The UMOD program now exits, with the grob and list variables modified,
and their names still on the stack. Next we want to assign the unit eV
(electron volt) to the STO key. Run UMOD. Note that the display now
shows "R" on the position corresponding to the MTH key. Press STO (the
key we want to modify.) Type the label, "eV" and ENTER. Choose "U" for
unit from the menu. Type "eV [ENTER]" again (or use the UNITS menu to
type it for you.) Congratulations, you have just created a unit menu
key. For those of you who are impatient, and want to try out your new
menu, store the program 
\<< 'GRB' 'LST' UMENU \>>
in a variable and run it whenever you want to try things out. Make
sure you restore the stack to having 'GRB' and 'LST' on levels 2 and 1
before running UMOD again.

Next, we often use the built in function IP and don't like
fishing through menus for it, so we'll assign this to the PRG key. Run
UMOD, press PRG, type the label INT (we prefer INT to IP, and the
label need not be the same), select P for program, type IP (the
function name) and we are done. (We are all big girls and boys now,
and I don't have to keep putting the ENTERs in the instructions, do
I?) Next, we are addicted to TETRIS, and are too lazy to push NXT
several times to find it in our horribly cluttered home directory, so
we'll assign it to the C key. Run UMOD (this still needs the names of
the grob and list variables on the stack, but if you have been
following instructions like good kiddies, they will still be there. If
you were so rude as to balance your checkbook half way through the
demonstration, put the names back again.) Press C. Type the label
Tetris. Oops! The label was too long. Type Ttrs. Push P for program.
Type TETRIS (or whatever you have named your tetris program.
(Batteries and Tetris program not included either.))

Having had nagging doubts, we pull out our "Eton Statistical & Math
Tables" and find out that the gas constant R is 8.317, not 8.314.
Damn. Let's change it. Run UMOD, press the MTH key (which we previously
assigned R to.) We don't want to change the label, just the value, so
just hit ENTER when asked for the label. C for constant object.
8.317_J/mol/K. Now, we have had second thoughts about using the label
"INT" for the IP function, and want to change it. Run UMOD, press PRG
(defined as INT), type the new label IP and choose N for no change, so
that only the label gets changed. The old function of the key (execute
IP) remains unchanged.

[Imagine endless tedium as we fill up the rest of the menu, with the
exception of the NXT key.]

Now the menu is full, but we still have an overwhelming desire to have
the launch date of the HP-19C calculator at our fingertips. (Ooooo!
What a sexy calculator that one was!) Cursing our lack of foresight
not to make the menu a row bigger, we decide to make a second menu,
with 6 rows so that we won't run out of space again. (Alright! The
person who said "Why not just assign the HP-19C date to the NXT key"
like to finish giving this lecture? No? Then don't interrupt.) (Hey,
it's midnight, and I'm tired. I'm livening things up with all these
silly parenthetical comments. If you don't like them, please feel free
to rewrite the instructions. (Seriously, if somebody wants to do a
better job, I'm only to happy for them to do so. (I thought the
whole point of RPN was to avoid all these stupid nested parenthesis.)))
Run UCLEAR again to make a new blank menu. Tell
it 6 rows. Notice how it makes the sizes of the label areas match the
different key sizes, and labels and reserves the alpha key. Pretty
neat, huh?  Store the nested blank lists in LST2 and the grob in GRB2.
Put 'GRB2' and 'LST2' on the stack. Run UMOD. Push the ENTER key. (The
HP-19C deserves no less.) Type the label HP-19C. Select C for
constant. Type the value: 1.091977 (dd.mmyyy format.)

Now we want to assign the NXT key on our original menu to access the
new menu. Drop 'GRB2' and 'LST2' from the stack. Hopefully, 'GRB' and
'LST' are now in levels 2 and 1. If not, PUT THEM BACK, BOZO! Run
UMOD. Press the NXT key. Type NEXT. Push M for Menu. You are asked for
the graphic variable name. Type GRB2. You are asked for the values
variable name. Type LST2. All done. We could assign the NXT key in the
GRB2/LST2 menu to run the GRB/LST menu as well.

This is the end of the tutorial. You will notice that I didn't give
any instructions on how to use the option "L-library constant" in the
menu of object types. There is a simple reason for this. This is to
access constants in the HP equation card, and the feature was put in
by whosit who wrote version 2 of the program. I don't have the
equation card (bought my calc before the free offer. sigh.) so I've
never tried to use this option.

Some final comments: You can also directly edit the grob and list
variables. This allows you to enlarge old menus and add shifted
functions to non-unit keys.
