Temporary User Mode Key Programs not working in RPN
#1

Writing a program to define a user key assignment works in CAS for me, but does not seem to work in RPN/Home mode. If I write:

KEY K_Sq(A,B,C)
BEGIN

RETURN {(-B+(B*B-4*A*C)^0.5)/(2*A),(-B-(B*B-4*A*C)^0.5)/(2*A)};

END;

the program works as expected in CAS, but putting 3 numbers on the stack in Home/RPN and doing 1U +/- does not run the app but just negates the level 1 item.

Ideas? Or is this a limitation of RPN mode?

Thanks for the discussion and comments.

#2

K_Sq assigns the x2 key, not +/-.

#3

Indeed. The best way to make sure you did the right key is to use the little "Create User Key" helper which is found in the "menu" button while in the editor. [MENU][4] "Press any key..." and then press the one you want.

TW

#4

Sorry, I knew that. It doesn't work on either key. I tried two different keys and both had the same problem. I just posted the wrong copy of the code.

Still have the problem (on both keys :)), any ideas?

Bruce

Would someone try it and see if it works on your?


Edited: 12 Oct 2013, 5:11 p.m.

#5

I tried to do a similar code and can't get it to work in either RPN or Home Mode.

However, I can call a separate program with user keys.


EXPORT QUAD(A,B,C)
BEGIN
RETURN {0.5*(-B+sqrt(B^2-4*A*C))/A,
0.5*(-B-sqrt(B^2-4*A*C))/A};
END;

In a program file with user keys:
KEY K_Sq()
BEGIN
RETURN "QUAD()";
END;

In RPN, press Shift + Help (User), x^2. Run QUAD(3) as QUAD uses 3 arguments.

#6

That works for me with the following caveats:

-- I can't use the K_Neg key, it only works on K_Sq (maybe others)

-- Don't know why I can't put the app in the K_Neg code, but doesn't work, you're correct

-- What do you *name* the program?

-- Do you have to Run the K_... program to install it?

Bruce

Edited: 13 Oct 2013, 5:47 p.m.

#7

hello,

a user key assignement can not take input parameters...

your function declaration should read:
key K_Sq() begin
...

end;

cyrille

#8

Thanks. Any idea why this can't be assigned to the K_Neg key?



Possibly Related Threads…
Thread Author Replies Views Last Post
  Does the HP Prime really compiles the user programs? CompSystems 3 2,705 12-13-2013, 01:55 PM
Last Post: Mike Morrow
  Integration question and "RPN" mode comment Craig Thomas 16 5,713 12-05-2013, 02:32 AM
Last Post: Nick_S
  HP Prime: Recommendation for future RPN Program Mode BruceTTT 3 2,103 11-13-2013, 10:03 PM
Last Post: BruceTTT
  [PRIME] RPN: another attempt at returning more than one value to the RPN stack Marcus von Cube, Germany 5 2,382 11-05-2013, 02:44 AM
Last Post: Marcus von Cube, Germany
  HP PRIME : strange behavior when trying user key capability Damien 12 3,803 11-03-2013, 11:02 AM
Last Post: Joe Horn
  Program to change entry mode on Prime Michael de Estrada 3 1,840 10-28-2013, 10:13 AM
Last Post: Han
  HP Prime Save Power Turn Off Not Working Timothy Roche 12 4,079 10-27-2013, 01:41 PM
Last Post: Michael de Estrada
  Prime: Exam mode (possible duplicate after funny response first time) Paul Townsend (UK) 1 1,440 10-24-2013, 03:09 PM
Last Post: Tim Wessman
  Does RPN entry mode cause the Prime keyboard to lock up ? Michael de Estrada 14 4,621 10-22-2013, 06:27 PM
Last Post: John Colvin
  HP Prime: Edit integer in RPN mode plivesey 15 4,778 10-18-2013, 04:34 PM
Last Post: kris223

Forum Jump: