HP Forums

Full Version: Minor bug in CHOOSE (rev. 6975)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
And crashes the emulator, too!
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])
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.
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
Reference URL's