ListBox

ListBoxFindText

Find the first list item whose text matches a search string

Syntax

Signature
int          ListBoxFindText( const ListBox *listBox, const char *text, int position, int caseSensitive, int exact );

Arguments

listBox the list box.

text the UTF-8 text to find. NULL returns 0.

position the one-based starting position. NIL or a value below 1 starts at the first item.

caseSensitive use T or NIL to match case, or F to ignore case.

exact use T to match the entire item text or F to match a prefix. NIL uses Set( _SET_EXACT, NIL ).

Return value

The one-based position of the first match, or 0 if no item matches, the search string is NULL or the object is NULL.

Description

The search runs from the starting position to the end of the list, then wraps to the beginning and continues up to the item preceding the start. A starting position past the last item searches from the beginning.

Exact searches compare the full text, including trailing characters. An empty prefix matches every item. The case-insensitive comparison uses the library's Unicode uppercase mapping. Use `ListBoxSelect()` to select a matching item.

See also