Re: [WP34s] new TVM-solver version Message #8 Posted by fhub on 11 May 2012, 8:33 a.m., in response to message #1 by fhub
In trying to make a new key-handling for another TVM version I've run into the following problem (with the ENTRY? command):
One thing I never liked with my TVM solver is that it doesn't have the usual key-layout "N I PV PMT FV" with these 5 keys in a single row, because the WP34s has only 4 user-keys.
So I've tried another solution with the user-key [A] as prefix, and then pressing [A]..[->] to get those 5 possible functions.
(e.g. [A][A] is N, and [A][->] is FV, etc.)
With the command KEY? this is in principle no problem, but unfortunately the program doesn't work as expected - it just doesn't make any difference if the user had previously entered any number (before calling one of these function-keys) or not. It seems that ENTRY? doesn't work anymore when using KEY?, but I have no explanation for this behaviour!?
Here's the code (only for the 'N' key, all other functions are identical):
015 LBL 00 // return after input or calculation
016 FS?C 00
017 SKIP 003
018 RCL- X
019 FILL // remove intermediate results
020 RCL L
021 STOP // wait for input or calculation
022 BACK 001 // [R/S] -> clears ENTRY? flag
023 LBL A // prefix [A]
024 CL[alpha]
025 [alpha]'N[space]I'
026 [alpha]'[space]PV'
027 [alpha] [space]
028 [alpha]'PMT'
029 [alpha]'[space]FV'
030 VIEW[alpha]
031 PSE 99
032 KEY? 00
033 BACK 003
034 LBL?[->]00
035 XEQ[->]00
036 GTO 00
037 LBL 11
038 ENTRY?
039 SF 00
040 FC? 00
041 XEQ 01
042 STO 01
043 CL[alpha]
044 [alpha]'N='
045 VW[alpha]+ 01
046 RTN
If I enter any number and press [A][A] then this number is stored in R01 and N is not calculated (which is ok).
But also if I don't enter any number (also after a R/S in line 021/022 which should reset the ENTRY? flag), N is not calculated but just stored again, i.e. XEQ 01 in line 041 is never executed although without any number entry it should be!?
So it seems KEY? (or maybe PSE or any other command) is setting the ENTRY? flag without having in fact entered anything.
Since I don't see any logical mistake in my code above, maybe it's a bug in the KEY? command?
(the official TVM version is working correctly without this ENTRY? problem)
Franz
Edited: 11 May 2012, 10:36 a.m.
|