FindItem Function (DomListBox)

Class

DomListBox

Action

Returns the index of an item in the list box.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

iIndex = list.FindItem(sItem)
Variable Description
iIndex The item index. INTEGER.
sItem The item to find. STRING.

Notes

If the item sItem is not found, FindItem returns zero (0).

Example

To find the index of the item with the name "Lookup" from the list box "MyDomListBox":

// Find the DomListBox in question
window w = Desktop.Find("/BrowserApplication//BrowserWindow//SELECT[@id='MyDomListBox']")
// Find the index of the item
INTEGER iIndex = w.FindItem("Lookup")