ListBox.FindItem

number ListBox.FindItem ( 

string ObjectName,

number StartAfter,

number SearchType,

string SearchText )

Description

Searches through the items in a listbox object for a specific string and returns the index (line number) where it was found.

Parameters

ObjectName

(string) The name of the listbox object.

StartAfter

(number) The index (line number) to start searching after. The search will begin in the next item in the list. You can use an index of -1 (or variable LB_ALLITEMS) to search all listbox items.

SearchType

(number) The type of search to perform:

CONSTANT

VALUE

DESCRIPTION

LB_BYTEXT

0

Search only the item text. (Default)

LB_BYDATA

1

Search only the associated item data.

LB_BYTEXTDATA

2

Search both the item text and item data.

SearchText

(string) The string of text to search for in the listbox object. You can use the * and ? wildcards in this field to search for text that matches a specific pattern.

Returns

(number) The first item index where the search string was found. If the string was not found or an error occurs, the value -1 (variable LB_ERROR) is returned. You can use Application.GetLastError to determine whether this action failed, and why.

ResultVariable

When adding an action with the script editor, you can use this field to specify a variable that the return value will be stored in.

See also:  Related Actions