Hi
I am trying to identify whether a variable I have passed to a listarray exists. If it does I can return the position of the variable using the following function, but how can I return something if it is not found in the list (e.g. variable not found in list so return -1)
PublicFunction WhereAmI_InArray(ByVal TelNum AsString) AsInteger
Dim counter As Integer
Dim aPhone As c_newPhone
For counter = 1 To phoneArray.Count - 1
aPhone = phoneArray(counter)
If aPhone.WhoAmI = TelNum Then
Return counter
End If
Next
End Function
Thanks