ui.ListBox.SetListBoxValues() renames the list box options.
Syntax
CALL <lbx_var>.SetListBoxValues("text")
Arguments
text |
text of the list box option (STRING, INTEGER, BOOLEAN, or other type) |
Usage and examples
Takes one argument - the text for the new list box option:
CALL lbx.SetListBoxValues("new_text")
You can also pass an array as the argument to ui.ListBox.SetListBoxValues():
CALL lbx.SetListBoxValues(["new_text1", "new_text2", "new_text3"])
Results of ui.ListBox.SetListBoxValues() depend on how many options your list box has originally included and how many texts you change by the method:
if the number of "old" options and "new" texts is equal, then all the options are renamed and keep their original values;
This example is based on the example program, listbox_ui_04_set_getlistboxvalues.
before:
after:
if there are less "old" options than "new" texts, then all the "old" options are renamed and keep their original values AND new options are added which have text but do not have value;
This example is based on the example program, listbox_ui_04_set_getlistboxvalues.
before:
after:
if there are more "old" options than "new" texts, then those options for which there are enough "new" texts are renamed and keep their original values BUT those options for which there are no "new" texts are deleted;
This example is based on the example program, listbox_ui_07_set_getlistboxvalues.
before:
after:
If you do not pass any arguments to SetListBoxValues(), you will get a runtime error - 9107. Wrong number of input parameters:
CALL lbx.SetListBoxValues()