Export (0) Print
Expand All

Array.GetValue Method (Int64[])

Gets the value at the specified position in the multidimensional Array. The indexes are specified as an array of 64-bit integers.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

[<ComVisibleAttribute(false)>]
member GetValue : 
        indices:int64[] -> Object

Parameters

indices
Type: System.Int64[]

A one-dimensional array of 64-bit integers that represent the indexes specifying the position of the Array element to get.

Return Value

Type: System.Object
The value at the specified position in the multidimensional Array.

ExceptionCondition
ArgumentNullException

indices is a null reference (Nothing in Visual Basic).

ArgumentException

The number of dimensions in the current Array is not equal to the number of elements in indices.

ArgumentOutOfRangeException

Any element in indices is outside the range of valid indexes for the corresponding dimension of the current Array.

The number of elements in indices must equal the number of dimensions in the Array. All elements in the indices array must collectively specify the position of the desired element in the multidimensional Array.

The GetLowerBound and GetUpperBound methods can determine whether any of the indexes is out of bounds.

This method is an O(1) operation.

The following code example demonstrates how to set and get a specific value in a one-dimensional or multidimensional array.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft