09-05-2015, 06:00 PM
If a user program is choosing from a list of items, that list of items might be empty (all the asteroids between 9 and 9 m in diameter, perhaps). If such an empty choice is offered, the only meaningful response is 0 or Escape. If instead the user enters OK or Enter, it appears as though item 65 536 in the list has been selected.
Speaking of large choice lists, scrolling would be tedious. An enhancement to allow the displayed choices to be filtered by a text string typed on-screen would ease choosing an item from a large list.
BTW, I was pleasantly surprised at how quickly CHOOSE can open a large list..
Code:
EXPORT CHOOSEBUG()
BEGIN
LOCAL CHOICE;
CHOOSE(CHOICE,"",{}); //USE ENTER OR OK
PRINT(CHOICE); //65 536
//GIVEN NO ITEMS TO SELECT SHOULD RETURN 0 (ESC)
//NOT ITEM 65 536
END;
Speaking of large choice lists, scrolling would be tedious. An enhancement to allow the displayed choices to be filtered by a text string typed on-screen would ease choosing an item from a large list.
BTW, I was pleasantly surprised at how quickly CHOOSE can open a large list..