On the WP43 VARMNU is the equivalent of the HP-42S VARMENU, however I don’t see how I can get on the WP43 the name of the variable softkey pressed to calculate it's value (this name is returned in the Alpha register on the 42S).
The HP-42S manual states page 126:
As an example of VARMENU usage here is the first program of the HP-42S Electrical Engineering Solutions (Voltage division):To continue program execution:
• Press a menu key.
• Or, press R/S.
If you continue by pressing a menu key, the name of the corresponding variable is stored into the Alpha register.
Your program can use this information to determine which key was pressed.
If you continue by pressing R/S, the Alpha register is not altered.
Code: Select all
00 { 148-Byte Prgm }
01▸LBL "V÷" @ Defines menu variables
02 MVAR "VT"
03 MVAR "V2"
04 MVAR "Z1"
05 MVAR "Z2"
06 CF 21 @ Sets or clears flag 21 to match flag 55.
07 FS? 55
08 SF 21
09▸LBL 00 @ Displays the variable menu and stops
10 CLA
11 VARMENU "V÷"
12 STOP
13 ATOX @ Determines which variable was selected by subtracting the ASCII codes
14 ATOX @ of the first two characters in the variable name. For example, when
15 - @ you press Z1 to calculate Z1, the program branches to LBL 41 because
16 XEQ IND ST X @ the ASCII code of "Z" is 90, the ASCII code of "1" is 49, and 90 - 49 = 41.
17 GTO 00
18▸LBL 36 @ Calculates V2
19 RCL "Z2"
20 RCL× "VT"
21 RCL "Z1"
22 LASTX
23 +
24 ÷
25 STO "V2"
26 VIEW "V2"
27 RTN
28▸LBL 02 @ Calculates VT
29 RCL "Z1"
30 RCL+ "Z2"
31 RCL× "V2"
32 RCL÷ "Z2"
33 STO "VT"
34 VIEW "VT"
35 RTN
36▸LBL 40 @ Calculates Z2
37 RCL "V2"
38 RCL× "Z1"
39 RCL "VT"
40 LASTX
41 -
42 ÷
43 STO "Z2"
44 VIEW "Z2"
45 RTN
46▸LBL 41 @ Calculates Z1
47 RCL "Z2"
48 RCL× "VT"
49 RCL÷ "V2"
50 RCL- "Z2"
51 STO "Z1"
52 VIEW "Z1"
53 END
Furthermore pressing a variable soft key without entering a value in X before doesn't resume the program execution after the STOP instruction as it does on the HP-42S.