ui.ComboBox.getIndexOf

Get an item position by name.

Syntax

getIndexOf(
   name STRING )
  RETURNING result INTEGER
  1. name is the name of a combobox item.

Usage

The getIndexOf() method takes an item name as parameter and returns the position of the item in the drop down list.

The first item is at position 1. The method returns 0 (zero) if the item name does not exist.

The next example checks for item existence, before adding the item.
IF cb.getIndexOf("SFO") == 0 THEN
  CALL cb.addItem("SFO", "San Francisco International Airport, CA" )
END IF