Post Reply 
Learning to program on the HP Prime (intermediate to advanced)
10-12-2020, 10:34 PM
Post: #9
RE: Learning to program on the HP Prime (intermediate to advanced)
Yes good idea of course.

To the OP: if your function doesn’t explicitly returns a value, then it returns the last calculated value of the function.

You also asked to learn how to use CHOOSE, well there is less mystery.

Code:

EXPORT CHOOSETEST()
BEGIN
 LOCAL CHOICE, LST := {"Apple","Pear","Cherry","Orange"};
 CHOOSE(CHOICE,"Make your choice", LST);
 IF CHOICE THEN
  MSGBOX("You chose " + LST[CHOICE]);
 ELSE
  MSGBOX("You chose nothing");
 END; 
 RETURN CHOICE; 
END;

Thibault - not collector but in love with the few HP models I own - Also musician : http://walruspark.co
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Learning to program on the HP Prime (intermediate to advanced) - pinkman - 10-12-2020 10:34 PM



User(s) browsing this thread: 1 Guest(s)