06-17-2021, 07:00 PM
Hello all,
I have a programming question that is trivial on my HP50g, but not so much with the Prime.
I often use my calculator as a simple "counter" for incrementing a number on the stack by a varying number, and I assign simple programs for these to softkeys.
The simplest possible example (as I do it on the 50g) - "count by 1":
<< 1 + >>
I store this as "CNT1", and press the softkey for it (after initially putting a zero on the stack), and I can increment the value on the stack with one button press.
For the Prime, I came up with a simple prog:
The above works, and assigns the countby() program to the unshifted comma key for the user keyboard.
In practice this is rather clunky, though:
- Put zero on stack
- Press shift
- Press Help (for user keyboard)
- Press comma key (which puts countby() in the command line)
- Press enter
Is there a more elegant way to do this without requiring 4 keypresses? (Maybe within a custom app with an option to change the count increment?)
Just fishing for ideas - I am sooo used to the RPL programming that this Prime is hard to get used to!
I have a programming question that is trivial on my HP50g, but not so much with the Prime.
I often use my calculator as a simple "counter" for incrementing a number on the stack by a varying number, and I assign simple programs for these to softkeys.
The simplest possible example (as I do it on the 50g) - "count by 1":
<< 1 + >>
I store this as "CNT1", and press the softkey for it (after initially putting a zero on the stack), and I can increment the value on the stack with one button press.
For the Prime, I came up with a simple prog:
Code:
// change the value in the RETURN statement for
// different count increments
EXPORT countby(c1)
BEGIN
RETURN c1+1;
END;
KEY K_Comma()
BEGIN
RETURN "countby()";
END;
The above works, and assigns the countby() program to the unshifted comma key for the user keyboard.
In practice this is rather clunky, though:
- Put zero on stack
- Press shift
- Press Help (for user keyboard)
- Press comma key (which puts countby() in the command line)
- Press enter
Is there a more elegant way to do this without requiring 4 keypresses? (Maybe within a custom app with an option to change the count increment?)
Just fishing for ideas - I am sooo used to the RPL programming that this Prime is hard to get used to!