Home

  choose clear

chooseChoose

The choose function prompts the user for a choice and returns the user's response, as follows:

"a" {b1...bn} c->bi 1
"a" {b1...bn} c->0

If the user selects OK, an item from the list and the real number 1 are placed on the stack. If the user selects Cancel, the real number 0 is placed on the stack.

"a" is the title of the list box containing the choices. {b1...bn} is a list of choices. c is the initial choice. Each element of the list can be either another list containing two items or any other object. If the element is another list, the first item is displayed to the user and the second item is returned to the stack, if selected. If the element is another type of object, the same object is displayed and returned to the stack, if selected.