#1
  1. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2013
    Posts
    29
    Rep Power
    0

    How we can Declare an array in VB. Net?


    How we can Declare an array in VB. Net.
  2. #2
  3. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,665
    Rep Power
    284
    if array of strings
    Dim yourArrayName() as string
    if array of Double
    Dim yourArrayName() as Double
    .....
    GK
    __________________________________________________ _____
    if you found this post is useful click Give Rep button (bottom side on this reply ) and agree
  4. #3
  5. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Feb 2014
    Location
    USA
    Posts
    11
    Rep Power
    0
    The following code shows how to declare an array in VB .NET. The value 10 gives the upper bound for the array. The lower bound is always 0 so this array contains 11 elements numbered 0 through 10.


    Dim values(10) As Integer


    As in VB 6, you can declare an array without bounds it. Later you can use ReDim to give it a size.


    Dim values() As Integer
    ...
    ReDim Preserve values(5)


    Declare multi-dimensional arrays by separating the dimensions with commas.


    Dim values1(9, 9) As Integer ' A 100 element array.

    Dim values2(,) As Integer ' No bounds yet.
    ReDim values2(9, 9) ' Give it bounds.

Similar Threads

  1. Please help.. How to declare and store elements in array
    By dawnong in forum Visual Basic Programming
    Replies: 1
    Last Post: April 29th, 2005, 01:16 AM
  2. Declare Array Size on the Fly
    By obfc123 in forum ASP Development
    Replies: 4
    Last Post: October 22nd, 2004, 12:04 PM
  3. how to declare a 2 index array?
    By cody in forum ASP Development
    Replies: 1
    Last Post: April 30th, 2004, 11:34 AM
  4. Use variable to declare an array
    By MindWeaver in forum ASP Development
    Replies: 2
    Last Post: April 22nd, 2004, 10:06 AM
  5. How can I declare an array of session variable?
    By Steve Schofield in forum ASP Development
    Replies: 1
    Last Post: April 12th, 2000, 03:12 AM

IMN logo majestic logo threadwatch logo seochat tools logo