CorArray: GetLength

GetLength

Gets a 32-bit integer that represents the number of elements in the specified dimension of the array.



 Public Function GetLength(
	  ByRef Arr As Variant,
	  ByVal Dimension As Long ) As Long

Parameters

Arr
[ByRef] Variant. The array to get the dimension length from.
Dimension
[ByVal] Long. A one-based dimension of the array whose length needs to be determined.

Return Values

Long -  A 32-bit integer that represents the number of elements in the specified dimension.

Remarks

An example of GetLength is GetLength(Arr, 1), which returns the number of elements in the first dimension of the array.

Exceptions

Exception Condition
ArgumentExceptionArr is not an array.
ArgumentNullExceptionArr is an uninitialized array.
IndexOutOfRangeException Dimension is less than one.
-or-
Dimension is greater than rank.

See Also

Project CorLib Overview

Class CorArray Overview

Length