ArrayList: IndexOf

IndexOf

Returns the index of the first occurrence of the value in the list.



 Public Function IndexOf(
	  ByRef Value As Variant,
	  Optional ByRef StartIndex As Variant,
	  Optional ByRef Count As Variant,
	  Optional ByVal Comparer As IComparer ) As Long

Parameters

Value
[ByRef] Variant. The value to search the list for.
StartIndex
[ByRef] Optional. Variant. The index to begin the search in the list.
Count
[ByRef] Optional. Variant. The number of items in the list to search.
Comparer
[ByVal] Optional. IComparer. A custom comparer to perform any special compare logic.

Return Values

Long -  The index of the first occurrence of value, or -1 if the value was not found.

Remarks

If there is special compare logic necessary, then a comparer object can be supplied. The compare object must implement the IComparer interface.

See Also

Class ArrayList Overview ArrayList Properties ArrayList Methods IList_Add Insert