HP Forums
Program to change entry mode on Prime - 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: Program to change entry mode on Prime (/thread-254007.html)



Program to change entry mode on Prime - Michael de Estrada - 10-27-2013

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 - Joseph Ec - 10-27-2013

Hi Friend,

Nice PRG. but:

IF CHOOSE(...)

THEN

Entry:=N-1;

END;

Same, short salute ;)

jose


Re: Program to change entry mode on Prime - Michael de Estrada - 10-28-2013

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 - Han - 10-28-2013

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.