HP Forums

Full Version: HP49G+: Nested Menus
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

How can I program nested soft menus?

i.e.

MATH ALG LIST...

Pressing MATH gives a submenu GAMMA BETA DBLFACT...
Pressing ALG gives submenu RISINGFACT SQWAVE SIMULT...
Pressing LIST gives submenu MAKELIST APPLYHP... and so on

I tried nested TMENU commands and had no success. Thanks in advance!

{ { NEST << { MENU1 MENU2 ... } TMENU >> } ... }

That should work. (didn't check though)

I tried

{{ TRIG << {SIN COS TAN} TMENU>> }} TMENU

and when I press TRIG, {SIN COS TAN} comes to the stack.

I'll have to try some way to manipulate this to get nested menus to work (will I have to resort to SysRPL?)

Of course. I wasn't thinking. The menu structure in the 48 series needs a small sysRPL command named TakeOver to run the menu context. If you have emacs/jazz isntalled, this is quite easy to do.

However, you can also use Wolfgang's program Keyman. One of the commands is ->TO or something similar. This appends this sysRPL command to the a program. Then you can build the list on the stack and it will work.

You won't see TakeOver in the program wafter running ->TO, but it is there. So you'll need { { TRIG << *(TakeOver)* { SIN COS TAN } TMENU >> } } and that will work.

Hi, Eddie;

I know the approach I'm showing here looks more like a cheating than a solution (in fact, it IS a cheating) but it works as it is a submenu. If what you want is the functionality instead of an actual submenu structure, this works. I based this sort of construction in the HP42S suggestion for submenu available in the HP42S Owner's Manual, when a program creates submenus for names of the month (or smething like this).I used this approach in some programs with a softmenu that "calls" another menu.

Try this:

MAIN
«
{
{"TXT1"«PROG1»}
{"TXT2"«PROG2»}
{"TXT3"«PROG3»}
""
{"GO 1"«MEN1»}
{"GO 2"«MEN2»}
} TMENU
»

MEN1
«
{
{"TXT4" «PROG4»}
{"TXT5" «PROG5»}
{"TXT6" «PROG6»}
{"TXT7" «PROG7»}
""
{"BACK" «MAIN»}
} TMENU
»

MEN2
«
{
{"TXT8" «PROG8»}
{"TXT9" «PROG9»}
{"TXTA" «PROGA»}
{"TXTB" «PROGB»}
""
{"BACK" «MAIN»}
} TMENU
»

After executing [MAIN] you'l see:
[TXT1] [TXT2] [TXT3] [    ]  [GO 1] [GO 2]
If you press either [GO 1] or [GO 2] you'll see each corresponding "submenu" with a rightmost [BACK] softkey that will bring the MAIN menu back. Either [GO 1] or [GO 2]
surelly accept nesting structures like this one.

Hope this "cheating" gives you a chance of doing something closer to what you want. I'm shure the compiled SysRPL version will do the trick, but I'd like knowing if there is actually some sort of submenu nesting capabilities inside the HP48 O.S.

Cheers.

Luiz (Brazil)

Edited: 30 Nov 2004, 1:16 a.m.

Why did I think of that, Luiz? LOL Your method looks very practical to me, light years away from cheating.

I would like to try Tim's command as well.

Thanks to you both.

Hi, Eddie;

thanks for your comments. I'm glad for my suggestion being handy. Great!

Now there's another possibility if you don't care using CST menu with actually nested temporary menus. Try this:

TEST
«
{
{ "OPT"
«
{
{ "YES" « "YES IS CHOSEN" 3 DISP 3 FREEZE 1 MENU » }
"" ; blank softkey
"" ; blank softkey
"" ; blank softkey
"" ; blank softkey
{ "NO" « "BAD CHOICE..." 3 DISP 3 FREEZE 1 MENU » }
} TMENU CLLCD " SELECT AN OPTION" 3 DISP 3 FREEZE
»
}
"" ; blank softkey
"" ; blank softkey
{ "PRG1" « "PROGRAM ONE OK" 3 DISP 3 FREEZE » }
"" ; blank softkey
{ "PRG2" "JUST A STRING" }
}'CST' STO 1 MENU
»
The "nested-like" structure is just for clarity (I hope...). All "3 DISP 3 FREEZE" are there as support so the example returns visual results.

In this case, all options are in the same object (in previous example there were three programs). The CST menu accepts temporary menus contained in programs (I guess the TMENU allows this as well, I did not check for ). the actual "trick" (another cheat, perhaps... Shame on me!) is the use of 1 MENU to call CST menu back after running TMENU options. If you load it and runn, you'll see that it produces the submenu effect as well. The biggest enhancement is the use of a single object, as I already mentioned, instead of many.

That's why I like programming RPL: it allows so many options we can't imagine. I'll dare going deep in SYSRPL soon, but I think I did not even touch UserRPL possibilities. I'm still finding UserRPl new possibilities as I'm going further.

Best regards.

Luiz (Brazil)


Edited: 1 Dec 2004, 2:32 a.m.