cArray

cArray


Provides methods for manipulating, searching and sorting arrays.

Remarks

This class cannot be directly instantiated. To access the methods use the class name directly.

 Debug.Print cArray.GetLength(MyArray)
 

See Also

Project VBCorLib Overview

Public:

Types:

NameDescription
 ciArrayTypes Represents the available array types that can be created using CreateInstance. The values corrispond the vbVarType enum.  

Methods:

NameDescription
 BinarySearch Performs a binary search on a given array. A subportion of the array can be searched using the startindex and length parameters. A custom user comparer can optionally be supplied to perform special comparisons between elements in the array.  
 Clear Clears a portion of the elements in an array.  
 Copy Copies one Array to another Array and performs type casting as necessary.  
 CopyEx Copies a section of one Array to another Array and performs type casting as necessary.  
 CreateInstance Initializes a new array of the specified type in up to 3 dimensions.  
 Exists Uses a callback method to check if an element in an array exists.  
 Find Uses a callback method to search an array for the first element that matches the criteria.  
 FindAll Finds all matching elements in an array, returning an array of the matched elements.  
 FindIndex Finds the index of the first array element that matches the criteria specified by the callback function.  
 FindLast Finds the last occurence of a matched element in the array.  
 FindLastIndex Finds the index of the last occurence of a matched element in the array.  
 ForEach Iterates over an array passing in each element into an Action function to be performed on the element.  
 GetLength Returns the number of elements in the specified dimension. If 0 is specified, this returns the total number of elements in the array.  
 GetRank Returns the number of dimensions in the array.  
 IndexOf Returns the index of the first occurrence of a value in a one-dimensional Array or in a portion of the Array.  
 IsNull Returns if an array variable is uninitialized.  
 LastIndexOf Returns the index of the last occurrence of a value in a one-dimensional Array or in a portion of the Array.  
 NewArray Creates an array of values.  
 Reverse Reverses the elements in a subportion of an array.  
 Sort Sorts an entire array. An optionally supplied comparer object can be used to compare special elements, such as userdefined values.  
 SortEx Sorts an array, or subportion, given a startindex and length. An optionally supplied comparer object can be used to compare special elements, such as userdefined values.  
 SortKey Sorts an entire array based on an array of keys. An optionally supplied comparer object can be used to compare special elements, such as userdefined values.  
 SortKeyEx Sorts an array based on an array of keys. A subportion of the array can be sorted given a startindex and length. An optionally, supplied comparer object can be used to compare special elements, such as userdefined values.  
 TrueForAll Returns a boolean indicating if all elements in the array matched the criteria.