Post Reply 
Learning to program on the HP Prime (intermediate to advanced)
10-09-2020, 10:16 PM (This post was last modified: 10-10-2020 02:40 AM by pinkman.)
Post: #5
RE: Learning to program on the HP Prime (intermediate to advanced)
... And of course the built in Help is very important for your learning curve.

Here is a simple “INPUT” example with radio button behavior:

Code:


EXPORT CHECKTEST()
BEGIN
 LOCAL I, R, I1, I2, I3, I4, I5;
 R := INPUT({{I1,4,{25,10,1}}, {I2,0,{25,10,2}}, {I3,0,{25,10,3}}, {I4,0,{25,10,4}}, {I5,0,{25,10,5}}},
      "Make your choice",
      {"Choice 1","Choice 2","Choice 3","Choice 4", "Choice 5"},
      {"Help text #1", "Help text #2", "Help text #3", "Help text #4", "Help text #5"});
 IF R THEN
  I := I1 + I2 * 2 + I3 * 3 + I4 * 4 + I5 *5;
  IF I THEN
   MSGBOX("You chose " + STRING(I));
  ELSE
   MSGBOX("You chose nothing");
  END; 
 ELSE
  MSGBOX("You canceled your choice");
 END;
END;

Edit: corrected after bug detection on I assignation

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-09-2020 10:16 PM



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