The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

Program to change entry mode on Prime
Message #1 Posted by Michael de Estrada on 27 Oct 2013, 11:12 a.m.

This program allows the entry mode to be changed from any screen without the need to enter the Home settings screen.

EXPORT Entry_Mode()
BEGIN
CHOOSE(N,"Entry_Mode","Textbook","Algebraic","RPN");
CASE
IF N==1 THEN
Entry:=0;
END;
IF N==2 THEN
Entry:=1;
END;
IF N==3 THEN
Entry:=2;
END;
DEFAULT
END;
END;

Edited: 27 Oct 2013, 11:13 a.m.

      
Re: Program to change entry mode on Prime
Message #2 Posted by Joseph Ec on 27 Oct 2013, 11:06 p.m.,
in response to message #1 by Michael de Estrada

Hi Friend,

Nice PRG. but:

IF CHOOSE(...)
THEN
Entry:=N-1;
END;

Same, short salute ;)
jose

            
Re: Program to change entry mode on Prime
Message #3 Posted by Michael de Estrada on 28 Oct 2013, 12:39 a.m.,
in response to message #2 by Joseph Ec

Actually, It's simpler than that:

BEGIN 
CHOOSE (...); 
Entry:=N-1; 
END;

Using IF..THEN is unnecessary and results in a syntax error.

                  
Re: Program to change entry mode on Prime
Message #4 Posted by Han on 28 Oct 2013, 10:13 a.m.,
in response to message #3 by Michael de Estrada

Quote:
Actually, It's simpler than that:

BEGIN 
CHOOSE (...); 
Entry:=N-1; 
END;

Using IF..THEN is unnecessary and results in a syntax error.


Your code actually produces an error if the user "cancels" the menu (presses [On] or [Esc]) because N would default to 0 and make Entry be equal to -1.

When using CHOOSE() inside IF THEN END, do not include the ";" at the end of CHOOSE() because it "ends" the block prematurely. This causes the syntax error. Instead, type

IF CHOOSE(...)  // no semi-colon like Joseph Ec originally suggested
THEN
Entry:=N-1;
END;

Edited: 28 Oct 2013, 10:14 a.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall