ui.ListBox.SetSelectedItems() selects one or more list box option.
Do not confuse ui.ListBox.SetSelectedItems() with any kind of input.
Options selected via ui.ListBox.SetSelectedItems() is not written to a variable automatically.
To be written to a variable, any option selected via ui.ListBox.SetSelectedItems() must be validated in the INPUT dialog.
Syntax
CALL <lbx_var>.SetSelectedItems(index)
Arguments
text |
index of the list box option |
Usage and examples
Takes one argument - the index for the new list box option starting from 0.
This argument can be an INTEGER, a STRING of figures, or a variable of these data types:
CALL lbx.SetSelectedItems(2)
CALL lbx.SetSelectedItems(slct)
You can also pass an array as the argument to ui.ListBox.SetSelectedItems():
CALL lbx.SetSelectedItems([1, 2, 3])
If you pass a wrong index (= the index of a non-existing option) to the method, nothing will happen.
If you do not pass any arguments to SetSelectedItems(), you will get a runtime error – 9107. Wrong number of input parameters:
CALL lbx.SetSelectedItems()