HP Forums
choose function behaviour - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: choose function behaviour (/thread-5211.html)



choose function behaviour - ji3m - 11-25-2015 03:38 PM

I use CHOOSE in many places in my pgm with various sized lists of items.

I always use the list input format.

Now, in some cases it numbers the items
but in others it doesnt.

in some cases it remembers the last selection and in others it doesnt whether they are numbered or not.

What determines how it behaves?

is there another undocumented argument?


RE: choose function behaviour - Tim Wessman - 11-25-2015 05:39 PM

(11-25-2015 03:38 PM)ji3m Wrote:  What determines how it behaves?

The shortcuts go from 1-9, then A-O. Any more then that and they won't be there because you'd start overriding keys. So basically, >24 means no shortcuts. For the grid chooser (which you don't have access to right now), they go from the 7 key, to the + key in a 4x4 grid (this matches the physical position of the grid in a 4x4 item).

Note that if ALPHA is turned on you can type and alphanumerically search the choose items.


RE: choose function behaviour - ji3m - 11-25-2015 06:25 PM

Ok. But what deterimes remembering last choice?


RE: choose function behaviour - Wes Loewer - 11-26-2015 04:31 AM

(11-25-2015 06:25 PM)ji3m Wrote:  Ok. But what deterimes remembering last choice?

Is this what you had in mind? The variable you pass to CHOOSE serves as both the default choice and as the choice made.

Code:

EXPORT Remember()
BEGIN
 LOCAL c;

 c:=1;
 REPEAT
  CHOOSE(c,"Remember","one","two","three","exit");
  MSGBOX("You selected "+c); 
 UNTIL c==4;

END;



RE: choose function behaviour - ji3m - 11-26-2015 06:56 PM

Thanks muchly. Explains a lot.

Wondered why it was call by reference.

Not in help, maybe in user guide..?