Array.GetValue Method (Int64)

 

Gets the value at the specified position in the one-dimensional Array. The index is specified as a 64-bit integer.

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

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

Parameters

index
Type: System.Int64

A 64-bit integer that represents the position of the Array element to get.

Return Value

Type: System.Object

The value at the specified position in the one-dimensional Array.

Exception Condition
ArgumentException

The current Array does not have exactly one dimension.

ArgumentOutOfRangeException

index is outside the range of valid indexes for the current Array.

The GetLowerBound and GetUpperBound methods can determine whether the value of index 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
Available since 1.1
Return to top
Show: