Syntax
Public Function ArrayBSearch(ary As Variant, value As Variant) As Integer
Description
This function is used to search for a specific value in given array.
Parameters
Key |
Description |
array | Array that want to search the value on it,value of type Variant. |
value | Value to be searched, Value of type Variant |
Return value
Return the index of a found element as Integer value.
Sample
Public Sub main () Dim Arr (5) Arr (1) = 1 Arr (2) = 2 Arr (3) = 4 Arr (4) = 6 Dim Index Index = ArrayBSearch (Arr, 2) AlertMessage (Index) returns the index of found element End sub
See Also