HP 50g Bug or Expected Behavior?
09-01-2014, 08:35 PM (This post was last modified: 09-01-2014 08:38 PM by John R. Graham.)
Post: #1
 John R. Graham Member Posts: 76 Joined: Dec 2013
HP 50g Bug or Expected Behavior?
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].

- John
09-01-2014, 09:52 PM (This post was last modified: 09-01-2014 10:13 PM by kakima.)
Post: #2
 kakima Junior Member Posts: 41 Joined: Dec 2013
RE: HP 50g Bug or Expected Behavior?
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.
09-01-2014, 11:31 PM
Post: #3
 Juan14 Junior Member Posts: 40 Joined: Jan 2014
RE: HP 50g Bug or Expected Behavior?
You learn something everyday. Thanks kakima.
09-02-2014, 12:57 AM (This post was last modified: 09-02-2014 12:58 AM by John R. Graham.)
Post: #4
 John R. Graham Member Posts: 76 Joined: Dec 2013
RE: HP 50g Bug or Expected Behavior?
(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.

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
09-02-2014, 02:06 AM
Post: #5
 kakima Junior Member Posts: 41 Joined: Dec 2013
RE: HP 50g Bug or Expected Behavior?
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.
09-02-2014, 02:34 AM
Post: #6
 Joe Horn Senior Member Posts: 1,848 Joined: Dec 2013
RE: HP 50g Bug or Expected Behavior?
(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].

- 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.

<0|ɸ|0>
-Joe-
09-02-2014, 03:11 PM (This post was last modified: 09-02-2014 03:22 PM by John R. Graham.)
Post: #7
 John R. Graham Member Posts: 76 Joined: Dec 2013
RE: HP 50g Bug or Expected Behavior?
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
09-02-2014, 03:22 PM
Post: #8
 Joe Horn Senior Member Posts: 1,848 Joined: Dec 2013
RE: HP 50g Bug or Expected Behavior?
(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!

<0|ɸ|0>
-Joe-
09-02-2014, 04:51 PM
Post: #9
 Tim Wessman Senior Member Posts: 2,280 Joined: Dec 2013
RE: HP 50g Bug or Expected Behavior?
(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... ;-)

TW

Although I work for HP, the views and opinions I post here are my own.
09-02-2014, 05:43 PM (This post was last modified: 09-02-2014 07:31 PM by John R. Graham.)
Post: #10
 John R. Graham Member Posts: 76 Joined: Dec 2013
RE: HP 50g Bug or Expected Behavior?
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
 « Next Oldest | Next Newest »