SELECTION-INDEX (numeric)

This property, when set, causes the list box selection to change to the indicated item. Items are numbered sequentially from the top of the list box, starting at 1.

Setting this value to -1 clears any selection. Values beyond the number of list box items are undefined. When queried, this property returns the item number of the current selection, or -1 if no item is selected. Using SELECTION-INDEX to change the list box focus causes a faint dotted-line box to appear around the selected item on graphical systems. On character-based systems, the text cursor is displayed at the end of the selected item. The end user presses the space bar to choose the item.