BB___SELECTIONINDEX

=SELECTIONINDEX= toc

Description
> Returns the index number of the selected string in a Listbox or Combobox list.

Hints

 * //**Index Selection.**// The index numbers begin with "1" in a Listbox or Combobox control. Remember, index numbers might not match array numbers (an array can have an index "0" for instance), especially if array items have been deleted and the list has been reloaded.

Example
code format="lb" 'Using SELECTIONINDEX? to obtain index number of selection nomainwin a$(1) = "apple" a$(2) = "orange" a$(3) = "banana" a$(4) = "pear"

listbox #win.lst, a$, [getIndex], 10, 10, 120, 200

open "Select Index Demo" for window as #win #win "trapclose Quit"

#win.lst "selectindex 1" wait

sub Quit handle$ close #handle$ end end sub

[getIndex] #win.lst "selectionindex? indexNum" notice "You chose Index number ";indexNum wait code

Useful Functions
code format="lb" Place a useful function using this keyword here code