Assigns a value to the element at the specified position in the multidimensional Array.
[Visual Basic] Overloads Public Sub SetValue( _ ByVal value As Object, _ ByVal indices() As Integer _ ) [C#] public void SetValue( object value, int[] indices ); [C++] public: void SetValue( Object* value, int* indices[] ); [JScript] public function SetValue( value : Object, indices : int[] );
None.
Exception Type | Condition |
---|---|
ArgumentNullException | indices is a null reference (in Visual Basic Nothing). |
ArgumentException | The number of dimensions in the Array is not equal to the number of elements in indices. |
IndexOutOfRangeException | Any element in indices is outside the range of valid indices for the corresponding dimension of the Array. |
The number of elements in indices must equal the number of dimensions in the Array. All elements in the indices array must collectively denote the position of the desired element in the multidimensional Array.
The GetLowerBound and GetUpperBound methods can be used to determine whether any of the indices is out of bounds.
Array Class | Array Members | System Namespace | Array.SetValue Overload List | GetLowerBound | GetUpperBound | GetValue