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
 ciArrayTypesRepresents the available array types that can be created using CreateInstance. The values corrispond the vbVarType enum. 

Methods:

NameDescription
 BinarySearchPerforms 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. 
 ClearClears a portion of the elements in an array. 
 CopyCopies one Array to another Array and performs type casting as necessary. 
 CopyExCopies a section of one Array to another Array and performs type casting as necessary. 
 CreateInstanceInitializes a new array of the specified type in up to 3 dimensions. 
 ExistsUses a callback method to check if an element in an array exists. 
 FindUses a callback method to search an array for the first element that matches the criteria. 
 FindAllFinds all matching elements in an array, returning an array of the matched elements. 
 FindIndexFinds the index of the first array element that matches the criteria specified by the callback function. 
 FindLastFinds the last occurence of a matched element in the array. 
 FindLastIndexFinds the index of the last occurence of a matched element in the array. 
 ForEachIterates over an array passing in each element into an Action function to be performed on the element. 
 GetLengthReturns the number of elements in the specified dimension. If 0 is specified, this returns the total number of elements in the array. 
 GetRankReturns the number of dimensions in the array. 
 IndexOfReturns the index of the first occurrence of a value in a one-dimensional Array or in a portion of the Array. 
 IsNullReturns if an array variable is uninitialized. 
 LastIndexOfReturns the index of the last occurrence of a value in a one-dimensional Array or in a portion of the Array. 
 NewArrayCreates an array of values. 
 ReverseReverses the elements in a subportion of an array. 
 SortSorts an entire array. An optionally supplied comparer object can be used to compare special elements, such as userdefined values. 
 SortExSorts 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. 
 SortKeySorts 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. 
 SortKeyExSorts 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. 
 TrueForAllReturns a boolean indicating if all elements in the array matched the criteria.