Array.SetValue : Array « System « VB.Net by API






Array.SetValue

  

Imports System


Public Class MainClass

   Shared Sub Main()
        Dim anArray As Array
        Dim l(0) As Integer
        Dim lowerBounds(0) As Integer
        l(0) = 7
        lowerBounds(0) = 1995
        'creates an array of objects numbered 1995 - 2002
        anArray = Array.CreateInstance(GetType(System.Int32), l, lowerBounds)
        anArray.SetValue(200000, 1995)
        anArray.SetValue(1000000, 2001)
        Console.WriteLine("The entry in position 1995 is " & _
        (anArray.GetValue(1995).ToString))
        Console.WriteLine("The entry in position 2002 is " & _
        (anArray.GetValue(2001).ToString))
   End Sub 

End Class

   
    
  








Related examples in the same category

1.Array.BinarySearch
2.Array.Clone
3.Array.Copy
4.Array.CreateInstance
5.Array.GetLowerBound
6.Array.GetUpperBound
7.Array.GetValue
8.Array.IndexOf
9.Array.LastIndexOf
10.Array.Length
11.Array.Reverse
12.Array.Sort