View Full Version : in array function
esthera
12-16-2006, 08:57 PM
can someone help me with how I would create a function that would take in an array and a value and check if that value exists in the array?
oracleguy
12-16-2006, 09:04 PM
Just off the top of my head:
Function inArray(byref array, byval data)
Dim found, arraylen, x
found = false
arraylen = ubound(array)
for x = 0 to arraylen
If array(x) = data Then
found = true
Exit For
End If
Next
inArray = found
End Function
I haven't tested it but that the gist of what you'd have to do.
sorry...thought it was a PHP question.
degsy
12-18-2006, 04:10 PM
Here is another example
http://forums.aspfree.com/code-bank-54/in-array-function-125932.html
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.