cArray: Exists |
Uses a callback method to check if an element in an array exists.
Public Function Exists( ByRef Arr As Variant, ByVal AddressOfMatch As Long ) As Boolean
Each array element is passed into a user callback method. The user then checks the element value to determine if it matches any criteria necessary and returns the result. The criteria is defined outside of the Exists method. How the criteria is defined and checked is up to the user of the function.
The function signature for the callback has a specific format.
Public Function ExistsCallback(ByRef x As [Array Datatype]) As Boolean ' return True if x matches your criteria. End SubThe [Array Datatype] must be replaced with the datatype of the array. If the array is an array of Variants, then [Array Datatype] would be a Variant, not any specific sub-type within the variants of the array.
Project VBCorLib Overview Class cArray Overview cArray Properties cArray Methods CreateInstance Find