(Comp.sys.hp48) Item: 3191 by randyd@csd4.csd.uwm.edu [Randall Elton Ding] Subj: HP 48SX Programming Questions Date: 11 Jan 1994 Documentation for DISPMENU and SHOWMENU. --> S/SX/G/GX >Article 17027 of comp.sys.hp48: >From: lupper@informatik.uni-ulm.de (Alfred Lupper) >Newsgroups: comp.sys.hp48 >Subject: HP 48SX Programming Questions > >Dear HP48 hackers, > >I have three problems programming the HP 48. > >1. How to manage that a program shows a menu in the menu line without >interrupting the program by input, prompt or halt? There are a couple of ways, first try -1 WAIT This will display the menu and wait for a keypress, returning the keycode. Here's a System-RPL method: [It's called SHOWMENU on this disk, ready to use. -jkh-] :: DA3OK?NOTIT ?DispMenu ; This just displays the menu setup by InitMenu (sys-rpl) or TMENU (user-rpl). Here is another way which uses ParOuterLoop to display a Custom (CST) style menu. It works just like a CST menu but from within a program. [It's called ALTMENU on this disk, ready to use. -jkh-] :: CK1NOLASTWD CK&DISPATCH1 list :: FALSE { LAM exit } BIND ' DispMenu.1 ( *display action* ) ' :: ( *hard key handler* ) kpNoShift #=casedrop :: DUP#<7 casedrop :: TRUE ' LAM exit STO FALSE ; kcNextRow #=casedrpfls kcLeftShift #=casedrpfls DROP 'DoBadKeyT ; kpLeftShift #=casedrop :: kcNextRow #=casedrpfls DROP 'DoBadKeyT ; 2DROP 'DoBadKeyT ; TrueTrue 5ROLL ONEFALSE ' LAM exit ' ERRJMP ParOuterLoop ABND ClrDAsOK ; ; Try using this in the following User-rpl example: %%HP:T(3); \<< @ some user program @ { { "key1" \<< "you pressed key1" \>> } { "key2" \<< "you pressed key2" \>> } { "key3" \<< "you pressed key3" \>> } { } { } { } } ALTMENU @ rest or your user program @ \>> This will display the menu keys "key1..key3" and 3 blank menu keys. Then it will wait for a keypress and then execute the program coorisponding to that key. The really good thing about this is that it allows you to use NXT key when there are more than 6 menu keys! IMPORTANT: Altmenu must have multiples of 6 keys defined, 6, 12, 18 etc. If you have any unused menukeys you must insert blank lists for them. Altmenu will exit with no action if you press a blank key and just beep if you press a key not in the menu row. Hope it is useful to someone, Randy.