Command Prompt for Windows

Command CBFIND


Search the list box of a combo box for a string beginning with the characters in the specified string. The index of the string found is stored in an environment variable called CBFIND.


CBFIND dlg_id id start "string"
dlg_idSpecifies the identifier of the dialog box that contains the combo box.
idSpecifies the identifier of the combo box.
startSpecifies the index of the string preceding the first string to be searched.
stringSpecifies a sequence of characters that contains the prefix to search for.


Indexes are zero based, that is, the first string in the list box of a combo box is at index 0, the second string is at index 1 and so on.

The search is not case sensitive.

When the search reaches the bottom of the list, it continues from the top of the list, back to the index specified by parameter start. If parameter start is -1 then the entire list is searched from the beginning.

When the list box of a combo box does not contain the specified string then a value of -1 is returned.

Also see command CBTEXT.