NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Array.CreateInstance (Type, Int32[], Int32[])

Creates a multidimensional Array of the specified Type and dimension lengths, with the specified lower bounds.

[Visual Basic]
Overloads Public Shared Function CreateInstance( _
   ByVal elementType As Type, _
   ByVal lengths() As Integer, _
   ByVal lowerBounds() As Integer _
) As Array
[C#]
public static Array CreateInstance(
   Type elementType,
   int[] lengths,
   int[] lowerBounds
);
[C++]
public: static Array* CreateInstance(
   Type* elementType,
   int* lengths[],
   int* lowerBounds[]
);
[JScript]
public static function CreateInstance(
   elementType : Type,
   lengths : int[],
   lowerBounds : int[]
) : Array;

Parameters

elementType
The Type of array to create.
lengths
A one-dimensional array containing the size of each dimension of the array to create.
lowerBounds
A one-dimensional array containing the lower bound (starting index) of each dimension of the array to create.

Return Value

A new multidimensional Array of the specified Type and dimension lengths, with the specified lower bounds.

Exceptions

Exception Type Condition
ArgumentNullException elementType is a null reference (in Visual Basic Nothing).

-or-

lengths is a null reference (Nothing).

-or-

lowerBounds is a null reference (Nothing).

ArgumentException elementType is not a valid Type.

-or-

lengths contains less than one element.

-or-

lengths and lowerBounds do not contain the same number of elements.

ArgumentOutOfRangeException Any value in lengths is less than 0.

Remarks

The lengths array and the lowerBounds array must have the same number of elements. The number of elements in the lengths array must equal the number of dimensions in the new array.

Each element of the lengths array must denote the length of the corresponding dimension in the new array.

Each element of the lowerBounds array must denote the lower bound of the corresponding dimension in the new array.

Reference-type elements are initialized to a null reference (Nothing). Value-type elements are initialized to 0.

See Also

Array Class | Array Members | System Namespace | Array.CreateInstance Overload List