User defined touch-button menu (Softkeys)
06-23-2019, 09:14 PM (This post was last modified: 09-17-2019 04:42 PM by Gene222.)
Post: #12
 Gene222 Member Posts: 105 Joined: Feb 2015
RE: User defined touch-button menu (Softkeys)
(06-22-2019 08:55 PM)Arch Wrote:  After I changed it to "." The syntax error was gone. Stupid really since I suspected that already and changed it and nothing happened. Seems you must change it, turn the Prime off and on again for the Prime to recognise the change.

Something like that happened to me when I was writing the program. The Prime would not recognize the revised program. Recompiling the revised program did not help. I had to toggle the User mode off then toggle it back on to recognize the revised program. Other times, the Prime would recognize the new program.

(06-23-2019 12:14 PM)Stevetuc Wrote:  If you remove the RETURN(30) then for your example
press: 45[Vars] SIN [Enter].
45sin() will appear on command line and then the result on pressing the [Enter] key

So, that is how the program is supposed works in RPN mode. Thanks.

[revised 6/24/19] Here's the program that will exit when pressing the Esc key. Pressing the Esc key will returns you back to where you were in the command line. It does not exit the command line, which is good when typing in a long equation on the command line. If you press the Vars key twice, it will open two functions menus. The two function menus can be exited by pressing the Esc key twice. So, it is important that the program can be closed by the Esc key.[/i]

[9/17/19] This is the final code of the program for this thread.
PHP Code:
KEY K_Vars()BEGIN  LOCAL ch_num,ch_items,func_list;  // choose items  ch_items:={"SIN","ASIN","COSH","ACOSH"};  // function list  func_list:={"SIN()","ASIN()","COSH()","ACOSH()"};  CHOOSE(ch_num,"Functions (Esc to exit)",ch_items);  IF ch_num==0 THEN  //Was Esc key pressed?    RETURN("");  ELSE    RETURN(func_list(ch_num));  END;END;
 « Next Oldest | Next Newest »