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.
Hi Friend,
Nice PRG. but:
IF CHOOSE(...)
THEN
Entry:=N-1;
END;
Same, short salute ;)
jose
Actually, It's simpler than that:
BEGIN
CHOOSE (...);
Entry:=N-1;
END;
Using IF..THEN is unnecessary and results in a syntax error.
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.