Post Reply 
Pause in WP34s
11-25-2015, 08:32 PM (This post was last modified: 11-26-2015 01:37 PM by Dieter.)
Post: #16
RE: Pause in WP34s
(11-25-2015 07:47 PM)ggauny@live.fr Wrote:  It was also the way in hp25, we puted fuel to consum and R/S, but I was thinking the hp67 given more difficult and excitation (?).

Of course having to enter the fuel within a second is more challenging. But you can have the same kind of thrill with the 34s.
Here is a sample routine:

Code:
ALL 03   // or FIX 0 if you prefer
#003
STO 01   // accept up to 3 digits for fuel entry
PSE 10
DSZ X    // display "3...2...1..."
BACK 002
STO 00   // set fuel = 0
RCL 00   // display fuel, resp. initially show "...0"
PSE 10
KEY? X
SKIP 009 // No entry? Then quit
KTP? X   // else check key type
#010
x<=y?    // key type >= 10? => no digit key, invalid.
BACK 007 // invalid key? get a new one. Punish this? Replace by SKIP 003 or even SKIP 005
RCLx 00  // build new fuel value = 10*old_value + new_digit
+
STO 00   // new fuel value
DSZ 01   // read another key (up to three)
BACK 012
RCL 00   // return fuel value
RTN

This routine accepts numeric input during the PSE with up to three digits (i.e. 0...999). If only one or two digits are entered (or nothing at all) that's fine either.

The BACK 007 line ingnores illegal keys (everything except 0...9) and allows the user to enter a valid digit. Replacing this by SKIP 003 also ignores invalid keys, but counts them as one of the three allowed keystrokes. And if SKIPĀ 005 is used instead, any non-numeric key directly cancels fuel input.

Try it. You see "3"..."2"..."1"..."0". Now enter a digit within the second the 0 is displayed. If you do, you may continue with a another and/or a third digit, thus building a two- and then three-digit number. Type [1], then [5], finally [3] and get fuel=153. Type [4] and get fuel=4. Enter nothing and fuel is 0. So the whole look and feel is much like the original HP67 version. ;-)

I am sure this can be done without using any data registers, but this way the code becomes more clear.

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Pause in WP34s - ggauny@live.fr - 11-25-2015, 12:41 PM
RE: Pause in WP34s - Dieter - 11-25-2015, 01:19 PM
RE: Pause in WP34s - walter b - 11-25-2015, 01:45 PM
RE: Pause in WP34s - emece67 - 11-25-2015, 02:40 PM
RE: Pause in WP34s - ggauny@live.fr - 11-25-2015, 04:47 PM
RE: Pause in WP34s - ggauny@live.fr - 11-25-2015, 03:47 PM
RE: Pause in WP34s - ggauny@live.fr - 11-25-2015, 04:58 PM
RE: Pause in WP34s - Didier Lachieze - 11-25-2015, 05:16 PM
RE: Pause in WP34s - Dieter - 11-25-2015, 07:01 PM
RE: Pause in WP34s - ggauny@live.fr - 11-25-2015, 05:43 PM
RE: Pause in WP34s - walter b - 11-25-2015, 06:22 PM
RE: Pause in WP34s - ggauny@live.fr - 11-25-2015, 06:41 PM
RE: Pause in WP34s - ggauny@live.fr - 11-25-2015, 06:38 PM
RE: Pause in WP34s - Dieter - 11-25-2015, 07:15 PM
RE: Pause in WP34s - ggauny@live.fr - 11-25-2015, 07:47 PM
RE: Pause in WP34s - Dieter - 11-25-2015 08:32 PM
RE: Pause in WP34s - rprosperi - 11-25-2015, 08:54 PM
RE: Pause in WP34s - ggauny@live.fr - 11-26-2015, 06:49 AM
RE: Pause in WP34s - Dieter - 11-26-2015, 01:24 PM
RE: Pause in WP34s - Marcus von Cube - 11-27-2015, 10:26 PM



User(s) browsing this thread: 1 Guest(s)