ui.Combobox.GetIndexOf() returns the text of the combo box option.
Syntax
DISPLAY <cmb_var>.GetIndexOf(<value>)
Arguments
value |
value of the combo box option (STRING, INTEGER, BOOLEAN, or other type) |
Usage and examples
Takes one argument - the value of the combo box option:
CALL cmb.GetIndexOf(value3)
This argument can be STRING, INTEGER, BOOLEAN, or of other type that is available for combo box options:
CALL cmb.GetIndexOf(3)
CALL cmb.GetIndexOf("value3")
You can pass a variable as an argument for ui.Combobox.GetIndexOf() (see example program, ui.ComboBox.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 ",cmb.GetIndexOf(value_var),"."
END IF
If you enter the wrong value, ui.Combobox.GetIndexOf() will return NULL:
If you do not pass any arguments to ui.Combobox.GetIndexOf(), you will get a runtime error - 9107. Wrong number of input parameters:
CALL cmb.GetIndexOf()