SELECT
Jump to navigation
Jump to search
Description
- Selects the Listbox or Combobox list item matching the string parameter and updates the display.
- For SELECT as used in SELECT CASE statements, see SELECT..CASE
Syntax
- print #handle.ext, "select string"
- print #handle.ext, "select "; string$
Hints
- Text Selection. Use SELECT when working with the text content of a list item, rather than its index number.
Example
'Using SELECT with a list
nomainwin
a$(1) = "apple"
a$(2) = "orange"
a$(3) = "banana"
a$(4) = "pear"
listbox #win.lst, a$(),doLst, 10, 10, 120, 200
open "Select Demo" for window as #win
#win "trapclose Quit"
' Use SELECT to highlight the default selection
#win.lst "select banana"
wait
sub Quit handle$
close #handle$
end
end sub
sub doLst handle$
#handle$ "selection? sel$"
notice "You chose ";sel$
end sub
Useful Procedures
' Place a useful function or sub using this keyword here