HP Forums

Full Version: In a program how do you program the ENTER key
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to write a simple program that changes the number of displayed decimal places on the stack to 3 with the minimum amount of user keystrokes but I cannot work out how to program the "ENTER" key so that you don't need to manually press the ENTER key on the calculator to get the program to run to completion.

The program is:-

Export FIX3()
BEGIN
3 ▶ HDigits
END ;

Any assistance would be greatly appreciated.
Set the format to "Fixed"

Code:

Export FIX3()
BEGIN
  HFormat:=1;
  HDigits:=3;
END ;
This gives the same result as my original program where FIX3 is displayed on the data entry line and you need to press the ENTER key.

I am trying to eliminate not having to press the ENTER key.
How are you running the program? By typing FIX3 on the keyboard and then pressing Enter? If so, you shouldn't have to press Enter a second time (as you seem to imply, but I can't figure out what you mean). Or are you running it from the Program Catalog? Or from the User Variable list? Please tell us exactly what you're doing and exactly what happens when you do it, to help us help you.
I understand that you are calling the FIX3 function from the toolbox and what you want is that when you select it is not inserted as editable text but that it is executed directly.
If so, this will definitely not be possible, since the function of the toolbox is to bring the identifiers on screen in edit mode.

An alternative is to keep the user keyboard active and assign an action for example to the LOG key

Code:
KEY K_Log()
BEGIN
  HFormat:=NOT HFormat;
  HDigits:=3; 
  -1
END;

[Image: giphy.gif]
The key assignment works - thanks.

Can you please explain what the line " -1 " does.


If I put it in a program starting with EXPORT it causes an error, yet when it is in a key assignment it runs and does something ??
The function should work regardless of whether EXPORT is used.

Apparently not documented in the user manual, but published in the release of FW 13333. The user keyboard can return a string in the edit field (return "string"), can also trigger the behavior of another key (return real+), and finally trigger the default behavior or do nothing (return real-)

(01-31-2018 05:24 PM)Tim Wessman Wrote: [ -> ]
Quote:Date Released: 2018/01/24

Internal Versions
-----------------
Firmware Version: 2018 01 24 (13333)
...
6. User key defines have been repositioned in the key handling process. They now will be done FIRST before anything else
a. Now all keys can be defined except SHIFT button, OFF and USER key.
b. Returning -1 will do NO operation in user key definition.
c. Returning -2 or less will perform default key behavior.
d. Be careful with your key definitions or you may hide some system functionality unintentionally
...
(02-21-2019 07:29 AM)Carlos295pz Wrote: [ -> ]The function should work regardless of whether EXPORT is used.

Apparently not documented in the user manual, but published in the release of FW 13333. The user keyboard can return a string in the edit field (return "string"), can also trigger the behavior of another key (return real+), and finally trigger the default behavior or do nothing (return real-)

(01-31-2018 05:24 PM)Tim Wessman Wrote: [ -> ]

EXAMPLEs, please
Reference URL's