cArray: IndexOf

IndexOf

Returns the index of the first occurrence of a value in a one-dimensional Array or in a portion of the Array.



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

Parameters

Arr
[ByRef] Variant. The array to search.
Value
[ByRef] Variant. The value to search for in the array.
Index
[ByRef] Optional. Variant. The index to the element in the array to begin search from.
Count
[ByRef] Optional. Variant. The number of elements to search, starting from startindex.
Comparer
[ByVal] Optional. IComparer. An optional comparer, primarily used for User-Defined types.

Return Values

Long -  Value indicating the index the value was found. If a value of less that the lower-bounds is returned, then the value was not found in the array.

Remarks

See Also

Project VBCorLib Overview Class cArray Overview cArray Properties cArray Methods GetRank IsNull