When I define menu keys in a program with KEYX or KEYG, are the key presses stored in a register?
That means I could do something like this:
"CHOICE 1"
KEY 1 XEQ 01
"CHOICE 2"
KEY 2 XEQ 01
...
LBL 01
<retrieve key number pressed>
<do something with the key number>
RTN
instead of having each key press jumping to its own label.
(Yes, I used the search, and read the manual, but couldn't find it.)
Thanks!
Program menu; key press remembered?
Re: Program menu; key press remembered?
How about using a flag to differentiate between two alternatives?
DM42 SN: 00041 β
WP 43S running on this device
HP-35, HP-45, ..., HP-35S, WP 34S, WP 31S, DM16L
WP 43S running on this device
HP-35, HP-45, ..., HP-35S, WP 34S, WP 31S, DM16L
-
- Posts: 802
- Joined: Tue May 02, 2017 5:48 pm
- Location: United States
- Contact:
Re: Program menu; key press remembered?
No. You can check whether or not Shift was pressed by testing flag 64, but for which key was pressed, the only information you have is which LBL was called.
(The flag 64 thing is a DM42/Free42 feature. It does not work on a real HP-42S or in Emu42.)
-
- Posts: 694
- Joined: Wed May 03, 2017 7:46 pm
- Location: Malone, NY USA
Re: Program menu; key press remembered?
Could each key store a different address in a register rather than XEQ and then do an indirect jump to that address?jthole wrote: ↑Mon Dec 14, 2020 8:36 amWhen I define menu keys in a program with KEYX or KEYG, are the key presses stored in a register?
That means I could do something like this:
"CHOICE 1"
KEY 1 XEQ 01
"CHOICE 2"
KEY 2 XEQ 01
...
LBL 01
<retrieve key number pressed>
<do something with the key number>
RTN
instead of having each key press jumping to its own label.
(Yes, I used the search, and read the manual, but couldn't find it.)
Thanks!
Tom L
If I buy someone a drink to congratulate them, is it a Mazel Tov cocktail?
DM10L SN: 059/100
DM41X SN: 00023 (Beta)
DM41X SN: 00506 (Shipping)
DM42 SN: 00025 (Beta)
DM42 SN: 00221 (Shipping)
If I buy someone a drink to congratulate them, is it a Mazel Tov cocktail?
DM10L SN: 059/100
DM41X SN: 00023 (Beta)
DM41X SN: 00506 (Shipping)
DM42 SN: 00025 (Beta)
DM42 SN: 00221 (Shipping)
Re: Program menu; key press remembered?
Maybe a possibility, but I am not sure that improves my current code. I think I am not going to spend more time on it nowtoml_12953 wrote: ↑Mon Dec 14, 2020 2:35 pmCould each key store a different address in a register rather than XEQ and then do an indirect jump to that address?
