HP Forums
Temporary User Mode Key Programs not working in RPN - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: Temporary User Mode Key Programs not working in RPN (/thread-252749.html)



Temporary User Mode Key Programs not working in RPN - BruceTTT - 10-12-2013

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.


Re: Temporary User Mode Key Programs not working in RPN - Marcus von Cube, Germany - 10-12-2013

K_Sq assigns the x2 key, not +/-.


Re: Temporary User Mode Key Programs not working in RPN - Tim Wessman - 10-12-2013

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


Re: Temporary User Mode Key Programs not working in RPN - BruceTTT - 10-12-2013

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.


Re: Temporary User Mode Key Programs not working in RPN - Eddie W. Shore - 10-13-2013

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.


Re: Temporary User Mode Key Programs not working in RPN - BruceTTT - 10-13-2013

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.


Re: Temporary User Mode Key Programs not working in RPN - cyrille de Brébisson - 10-14-2013

hello,

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

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

end;

cyrille


Re: Temporary User Mode Key Programs not working in RPN - BruceTTT - 10-14-2013

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