HP Forums
Minor bug in CHOOSE (rev. 6975) - 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: Minor bug in CHOOSE (rev. 6975) (/thread-2866.html)



Minor bug in CHOOSE (rev. 6975) - Snorre - 01-16-2015 02:35 PM

Hello,

The following crashes the Prime:
Code:
KEY K_Menu()
BEGIN
  CHOOSE(N,"Lunch",{"Salad","Yogurt"});
  RETURN "Steak"; 
END;
  1. Press user key [Menu]
  2. Press user key [Menu] again
  3. Cancel selection by tapping outside of choose box
Greetings


RE: Minor bug in CHOOSE (rev. 6975) - Han - 01-16-2015 04:15 PM

And crashes the emulator, too!


RE: Minor bug in CHOOSE (rev. 6975) - Snorre - 01-16-2015 08:46 PM

Pressing user key [Menu] a third time followed by another key results in
  • either an immediate crash/reboot (e.g. on [Esc] or [Enter])
  • or an endless flickering exclamation mark symbol ([On]+[Symb]-restart needed) (e.g. on [SIN] or [5])



RE: Minor bug in CHOOSE (rev. 6975) - Tim Wessman - 01-16-2015 09:05 PM

Guessing the user "choose" is doing something funny and assuming there will never be more then a single choose up at once. I can't see any possible way of actually getting a second one up at a time without going through the user key mechanism though.


RE: Minor bug in CHOOSE (rev. 6975) - Snorre - 01-16-2015 10:20 PM

Hello Tim,

Therefore I'd call it a minor bug (maybe more an inconvenience) and had never even noticed if I hadn't accidently hit the user key twice and got curious about the second choose box popping up.
I tried the same with an input form, but that rejected to open another one while the first was still open. Also, [View] and [Paste] won't show up while another choose box is waiting. Maybe there's a check that could easily be adapted to user choose boxes too; something similiar to the PPL workaround
Code:
choosing:=0;
EXPORT MYCHOOSE(selection,title,options)
BEGIN
  IF choosing THEN RETURN 0; END;
  choosing:=1;
  CHOOSE(selection,title,options);
  choosing:=0;
  RETURN selection;
END;
(The downside: slightly different semantics and doesn't help with Prime-internal choose boxes)

Greetings