ArraysEx
Previous  Next

The ArraysEx object provides the following methods and a single property.



Methods

BinarySearch(array as Array(), start As Int32, count as Int32, value As String, compare As Int32) : Performs a fast search for value in the specified one-dimensional sorted array, examining count items from start index position. If value is not found a negative number is returned. If the absolute value of this number is greater than or equal to the size of the array, there are no elements larger than value in the array. Otherwise, it is the index of the first element that is larger than value. compare determines how the comparison is done. It may be cNumber, cCaseSensitive or cCaseUnsensitive and should be the same as was used to sort the array. The array must be sorted. Duplicate elements are allowed. If the Array contains more than one element equal to value, the method returns the index of only one of the occurrences, and not necessarily the first one.

Clear(array As Array(), start As Int32, count As Int32) : Sets count number of elements in array, starting at index position start, to zero, false, or null depending on the element type.

Clone(array as Array) : Returns a copy of array. e.g.  b() = Clone(a())

IndexOf(array As Array(), value As String , start As Int32, count As Int32) : Returns the position of the first occurrence of value in array starting at index start and looking over count elements. Returns -1 if value is not found.

LastIndexOf(array As Array(), value As String , start As Int32, count As Int32) : Returns the position of the last occurrence of value in array starting at index start and looking backwards over count elements. Returns -1 if value is not found.

New1 : Creates a new ArraysEx object.

Rank(array As Array()) : Returns the number of dimensions of array.

Reverse(array As Array(), start As Int32, count As Int32) : Reverses the order of count elements of the array starting at index position start.

Sort(array As Array, start As Int32, count As Int32, compare As Int32) : Sorts count elements of the one-dimensional  array starting at index position start. compare determines how the comparison is done. It may be cNumber, cCaseSensitive or cCaseUnsensitive.


SortKeysAndItems(keys As Array, object items As Array, start As Int32, count As Int32, compare As Int32) :  Sorts a range of elements in a pair of one-dimensional arrays one containing the keys and the other containing the corresponding items. Sorts count elements of the keys array starting at index position start and adjusting the items array accordingly so that the original key/item pairs remain at the corresponding positions in the two arrays. compare determines how the comparison is done. It may be cNumber, cCaseSensitive or cCaseUnsensitive.

TotalLength(array As Array()) : returns the total number of elements in the array considering all the dimensions of the array unlike ArrayLen which gives the number of elements in a single dimension of the array.


Property

I signifies readable, O signifies settable.

Dllversion : Double [I] : Gets the version number of this library.