Create dynamic array multi-dimension

Discussion in 'ASP General' started by GeckoNewsgroup, Feb 12, 2004.

  1. Hi,

    When a try this script:

    NbrAuteur = 19

    Dim arrTestArray()
    intSize = 0

    1: For x = 0 to (nbrAuteur - 1)
    2: ReDim Preserve arrTestArray(intSize,3)
    3: arrTestArray(intSize,0) = objRS("prenom")
    4: intSize = intSize + 1
    5: objRS.movenext
    6: Next

    I have this msg error:

    Microsoft VBScript runtime error '800a0009'
    Subscript out of range
    Line 2
     
    GeckoNewsgroup, Feb 12, 2004
    #1
    1. Advertising

  2. GeckoNewsgroup

    Ray at Guest

    You can only redimension the last dimension of an array.

    Redim preserve anArray(2,4,2,43,VariableNumber)

    Ray at work

    "GeckoNewsgroup" <> wrote in message
    news:BC512DD7.838%...
    > Hi,
    >
    > When a try this script:
    >
    > NbrAuteur = 19
    >
    > Dim arrTestArray()
    > intSize = 0
    >
    > 1: For x = 0 to (nbrAuteur - 1)
    > 2: ReDim Preserve arrTestArray(intSize,3)
    > 3: arrTestArray(intSize,0) = objRS("prenom")
    > 4: intSize = intSize + 1
    > 5: objRS.movenext
    > 6: Next
    >
    > I have this msg error:
    >
    > Microsoft VBScript runtime error '800a0009'
    > Subscript out of range
    > Line 2
    >
     
    Ray at, Feb 12, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Adam Hartshorne

    Multi-Dimension Array Question

    Adam Hartshorne, Jun 8, 2005, in forum: C++
    Replies:
    6
    Views:
    2,144
  2. Makiyo
    Replies:
    3
    Views:
    535
    Richard Heathfield
    Feb 22, 2004
  3. Eric Laberge

    Multi-dimension array assignments

    Eric Laberge, Aug 22, 2005, in forum: C Programming
    Replies:
    3
    Views:
    463
    Dave Thompson
    Aug 27, 2005
  4. Replies:
    11
    Views:
    526
    Alexei A. Frounze
    Sep 29, 2005
  5. Luuk
    Replies:
    15
    Views:
    831
    Nobody
    Feb 11, 2010
Loading...

Share This Page