Finding an Element in an Array
Category:Lists, Collections and Arrays
Version Compatibility: Visual Basic 6, Visual Basic 5
In VB5 and VB6, there is no "native way" of searching the elements of an Array for a match. This little snippet will help you do just that. If there's no match, it returns 0 (zero), if there is, it returns the index of the first match. Simply place this code into a function.
Instructions: Copy the declarations and code below and paste directly into your VB project.