Single User Defined Program Key Press to Answer.
|
07-06-2021, 09:39 PM
(This post was last modified: 07-06-2021 09:40 PM by matalog.)
Post: #1
|
|||
|
|||
Single User Defined Program Key Press to Answer.
This little program, will take the last entry in the stack (in Algebraic mode anyway) and use it to display the subtotal, and amount of tax.
Code: KEY K_Ln() It assumes the last number on the stack is the total including tax, and that you want, what the total would have been before tax, and the amount of tax. Pressing LN activates it. Rather than teaching people how to calculate tax, it is an example of a program that works by a single keypress and displays a result. Return 46; at the end of the program ensures that the program doesn't return anything to the stack, or the live calculator line. It basically presses the On button, which I assume to be harmless. Any suggestions of a way to get the result to the stack would be very welcome! |
|||
07-09-2021, 07:27 PM
Post: #2
|
|||
|
|||
RE: Single User Defined Program Key Press to Answer.
Hello, how did you learn RETURN 46; is like pressing the on button?
Might you know the value for the ENTER key? |
|||
07-09-2021, 09:52 PM
Post: #3
|
|||
|
|||
RE: Single User Defined Program Key Press to Answer.
(07-09-2021 07:27 PM)kevinwaite Wrote: Hello, how did you learn RETURN 46; is like pressing the on button? I have attached the image from page 652 of the manual, which describes what the rules are for GETKEY. I discovered that the result of a program (or key instruction) written this way, will be that the 'number' returned, will show itself as the key that the 'number' represents. The ENTER key will be 30 and shift and ENTER should be 51+30, with alpha+ENTER being 51+51+30, and shift+alpha+ENTER being 51+51+51+30. I assume that there could be some use for this, but I cannot think of a good one off hand. The use of a Key instruction program like this, seems to be bound to only outputting a single instruction to be used to simulate the press of a key. |
|||
07-09-2021, 10:43 PM
Post: #4
|
|||
|
|||
RE: Single User Defined Program Key Press to Answer.
(07-06-2021 09:39 PM)matalog Wrote: Return 46; at the end of the program ensures that the program doesn't return anything to the stack, or the live calculator line. It basically presses the On button, which I assume to be harmless. Not quite harmless. On button clear line entry. Return ""; may be more "harmless". |
|||
07-11-2021, 04:29 AM
Post: #5
|
|||
|
|||
RE: Single User Defined Program Key Press to Answer.
RETURN 46;
On my hp prime puts 46 on the level 1: stack location. Hmm? |
|||
07-11-2021, 09:45 AM
Post: #6
|
|||
|
|||
RE: Single User Defined Program Key Press to Answer.
(07-11-2021 04:29 AM)kevinwaite Wrote: RETURN 46; It sounds like you didn't use the program at the start of this post. The behaviour you describe is what people here actually want, but it isn't attainable from a single key press. What you are describing is usually achieved by adding RETURN 46; just before END; in a normal program that begins with EXPORT NAME(), and not KEY N_AME(). |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)