SELECTION
Jump to navigation
Jump to search
Description
- Returns the highlighted text from a list item in a Listbox or Combobox. The selection is placed into the variable selected$.
Syntax
- print #handle, "selection? selected$"
Hints
- No selection. If no text or list item is selected, the variable value will be an empty string (e.g. "").
Example
' An example using SELECTION? with a listbox.
nomainwin
a$(1) = "one"
a$(2) = "two"
a$(3) = "three"
a$(4) = "four"
listbox #win.listbo, a$(),doListbo,10,10,120,200
open "Selection? Demo" for window as #win
#win "trapclose Quit"
#win.listbo "selectindex 1"
wait
sub Quit handle$
close #handle$
end
end sub
sub doListbo handle$
'Get the text value from selection and place it in sel$ variable.
#handle$ "selection? sel$"
notice "You chose ";sel$
end sub
Useful Procedures
' Place a useful function or sub using this keyword here