HP Forums
HP 50g Bug or Expected Behavior? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: HP 50g Bug or Expected Behavior? (/thread-2057.html)



HP 50g Bug or Expected Behavior? - John R. Graham - 09-01-2014 08:35 PM

I have a little program called Timer that I use to benchmark the execution time of other programs. It's really simple:
Code:
%%HP: T(3)A(R)F(.);
\<< TIME \-> startTime
  \<< EVAL TIME
startTime HMS-
  \>>
\>>
I use it enough that I assign it to a key (in this case [Left Shift][HIST]). So, when I want to benchmark a program, I type the program's parameters (if any), separated by spaces, hit the single quote followed by the program-to-benchmark's soft key and then hit [Cursor Right][Left Shift][HIST].

Now, what I believe should happen is that the whole entry line should be evaluated. What actually happens, is that "Timer" gets added to the entry line and I have to press [ENTER] to execute the lot. I should note that the Timer function will execute with no redundant [ENTER] keypress if I put all the arguments including the quoted program name on the stack prior to hitting [Left Shift][HIST], but that just moves the redundant [ENTER] keypress somewhere else.

The proximal cause appears to be that the single-quoted program name puts the entry line into Algebraic mode (as shown by the ALG annunciator at the top of the screen). The only way to get the entry line out of Algebraic mode is to press [ENTER].

Am I thinking about this correctly?

- John


RE: HP 50g Bug or Expected Behavior? - kakima - 09-01-2014 09:52 PM

Just out of curiosity, wouldn't it be simpler just to assign TEVAL to a key instead of using a program to mimic it?

Edit: I realize this does not address the question. I'm just curious why you use a program that does the same thing as a built-in.


RE: HP 50g Bug or Expected Behavior? - Juan14 - 09-01-2014 11:31 PM

You learn something everyday. Thanks kakima.


RE: HP 50g Bug or Expected Behavior? - John R. Graham - 09-02-2014 12:57 AM

(09-01-2014 09:52 PM)kakima Wrote:  Just out of curiosity, wouldn't it be simpler just to assign TEVAL to a key instead of using a program to mimic it?

Edit: I realize this does not address the question. I'm just curious why you use a program that does the same thing as a built-in.
The reason is simple: I had missed TEVAL and didn't know about it. Thank you. Smile

However, I think the question legitimately remains. A builtin, operating on a combination of entry line and stack does not require a redundant [ENTER] key to be pressed but a User RPL program, under certain circumstances, does.

- John


RE: HP 50g Bug or Expected Behavior? - kakima - 09-02-2014 02:06 AM

I'm still playing with this and thinking out loud, so bear with me.

If I place the arguments, quote the program name, and press the assigned key, it requires an ENTER. Just as the original post states.

If I place the arguments, the program name without quotes, and press the assigned key, the program executes. The problem with this approach is that the program name has to be spelled out. Hitting the softkey for the program causes immediate execution.

Another alternative is to place the arguments on the stack, then the program itself (not its name) by hitting right-shift then the softkey, then executing TEVAL. Keystroke wise, it replaces the quote with the right-shift and eliminates the ENTER.

I guess I've just gotten used to doing it that way. Maybe you need to consider retraining your fingers to hit right-shift instead of quote.

Again (and still) this doesn't directly address the original question as to why the 50g behaves as it does.


RE: HP 50g Bug or Expected Behavior? - Joe Horn - 09-02-2014 02:34 AM

(09-01-2014 08:35 PM)John R. Graham Wrote:  I have a little program called Timer that I use to benchmark the execution time of other programs. It's really simple:
Code:
%%HP: T(3)A(R)F(.);
\<< TIME \-> startTime
  \<< EVAL TIME
startTime HMS-
  \>>
\>>
I use it enough that I assign it to a key (in this case [Left Shift][HIST]). So, when I want to benchmark a program, I type the program's parameters (if any), separated by spaces, hit the single quote followed by the program-to-benchmark's soft key and then hit [Cursor Right][Left Shift][HIST].

Now, what I believe should happen is that the whole entry line should be evaluated. What actually happens, is that "Timer" gets added to the entry line and I have to press [ENTER] to execute the lot. I should note that the Timer function will execute with no redundant [ENTER] keypress if I put all the arguments including the quoted program name on the stack prior to hitting [Left Shift][HIST], but that just moves the redundant [ENTER] keypress somewhere else.

The proximal cause appears to be that the single-quoted program name puts the entry line into Algebraic mode (as shown by the ALG annunciator at the top of the screen). The only way to get the entry line out of Algebraic mode is to press [ENTER].

Am I thinking about this correctly?

- John

You are correct: it happens because you pressed the quote key [ ' ], which means that you've flipped your 50g into algebraic-entry mode, in which most keys (e.g. SIN, +, etc) no longer act immediately, but place their names on the command line (thus making it possible to type algebraic expressions). There IS a way to exit ALG mode without pressing ENTER: Press right-shift ALPHA (labeled ENTRY)... but that flips into program mode, so that usually doesn't help much.

Suggestion: Instead of storing that program as 'Timer' and assigning 'Timer' to the CMD key, assign the program itself to the CMD key. This will cause it to be executed even in ALG mode without pressing ENTER.


RE: HP 50g Bug or Expected Behavior? - John R. Graham - 09-02-2014 03:11 PM

Joe,

Thank you very much. That work-around does indeed hide the issue effectively (although instead of assigning the Timer program to a key, I assigned a little stub program that called Timer as its only action). I'm still inclined to call this a bug, though.

A better behavior of the entry line would be if the calculator automatically exited algebraic entry mode as soon as the cursor left the confines of the bracketing single quotes. One can dream, I guess.

- John


RE: HP 50g Bug or Expected Behavior? - Joe Horn - 09-02-2014 03:22 PM

(09-02-2014 03:11 PM)John R. Graham Wrote:  A better behavior of the entry line would be if the calculator automatically exited algebraic entry mode as soon as the cursor left the confines of the bracketing single quotes.

That would be cool!


RE: HP 50g Bug or Expected Behavior? - Tim Wessman - 09-02-2014 04:51 PM

(09-02-2014 03:11 PM)John R. Graham Wrote:  A better behavior of the entry line would be if the calculator automatically exited algebraic entry mode as soon as the cursor left the confines of the bracketing single quotes. One can dream, I guess.

Or buy a Prime, which does exactly that... ;-)


RE: HP 50g Bug or Expected Behavior? - John R. Graham - 09-02-2014 05:43 PM

Tim,

I own a Prime (purchased almost as soon as it was available) but, for reasons I think you mostly understand, it's not yet ready to be my daily driver, although I have high hopes for the future. I intend to eventually write a longish post on what I believe the Prime needs to gain for scientists and engineers. I haven't been it a tearing hurry to write this because I can't imagine it will contain much that you don't already know.

Love the screen; the key tactile feel is good; love the large [Enter] key; but, no, not my daily driver—yet.

- John