View Full Version : in array function

12-16-2006, 07: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?

12-16-2006, 08: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

inArray = found
End Function

I haven't tested it but that the gist of what you'd have to do.

12-16-2006, 09:02 PM
sorry...thought it was a PHP question.

12-18-2006, 03:10 PM
Here is another example

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum