Array.SetValue Method (Object, Int64, Int64, Int64)
Sets a value to the element at the specified position in the three-dimensional Array. The indexes are specified as 64-bit integers.
Assembly: mscorlib (in mscorlib.dll)
[<ComVisibleAttribute(false)>] member SetValue : value:Object * index1:int64 * index2:int64 * index3:int64 -> unit
Parameters
- value
-
Type:
System.Object
The new value for the specified element.
- index1
-
Type:
System.Int64
A 64-bit integer that represents the first-dimension index of the Array element to set.
- index2
-
Type:
System.Int64
A 64-bit integer that represents the second-dimension index of the Array element to set.
- index3
-
Type:
System.Int64
A 64-bit integer that represents the third-dimension index of the Array element to set.
| Exception | Condition |
|---|---|
| ArgumentException | The current Array does not have exactly three dimensions. |
| InvalidCastException | value cannot be cast to the element type of the current Array. |
| ArgumentOutOfRangeException | index1 or index2 or index3 is outside the range of valid indexes for the corresponding dimension of the current Array. |
The GetLowerBound and GetUpperBound methods can determine whether any of the indexes is out of bounds.
For more information about conversions, see Convert.
This method is an O(1) operation.
Note |
|---|
If SetValue is used to assign null to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. |
Available since 1.1
