ui.ListBox.GetIndexOf() returns the text of the list box option.
Syntax
DISPLAY <lbx_var>.GetIndexOf(<value>)
Arguments
value |
value of the list box option (STRING, INTEGER, BOOLEAN, or other type) |
Usage and examples
Takes one argument - the value of the list box option:
CALL lbx.GetIndexOf(value3)
This argument can be STRING, INTEGER, BOOLEAN, or of other type that is available for list box options:
CALL lbx.GetIndexOf(3)
CALL lbx.GetIndexOf("value3")
You can pass a variable as an argument for ui.ListBox.GetIndexOf() (see example program, ui.ListBox.getIndexOf):
LET value_var=fgl_winprompt(5,3,"Enter the option's value (Example: value2).","",25,0)
IF value_var IS NOT NULL THEN
DISPLAY "The option's index is ",lbx.GetIndexOf(value_var),"."
END IF
If you enter the wrong value, ui.ListBox.GetIndexOf() will return NULL:
If you do not pass any arguments to ui.ListBox.GetIndexOf(), you will get a runtime error - 9107. Wrong number of input parameters:
CALL lbx.GetIndexOf()