Create dynamic array multi-dimension

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • GeckoNewsgroup

    Create dynamic array multi-dimension

    Hi,

    When a try this script:

    NbrAuteur = 19

    Dim arrTestArray()
    intSize = 0

    1: For x = 0 to (nbrAuteur - 1)
    2: ReDim Preserve arrTestArray(in tSize,3)
    3: arrTestArray(in tSize,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

    #2
    Re: Create dynamic array multi-dimension

    You can only redimension the last dimension of an array.

    Redim preserve anArray(2,4,2,4 3,VariableNumbe r)

    Ray at work

    "GeckoNewsgroup " <gecko@myToto.c om> wrote in message
    news:BC512DD7.8 38%gecko@myToto .com...[color=blue]
    > Hi,
    >
    > When a try this script:
    >
    > NbrAuteur = 19
    >
    > Dim arrTestArray()
    > intSize = 0
    >
    > 1: For x = 0 to (nbrAuteur - 1)
    > 2: ReDim Preserve arrTestArray(in tSize,3)
    > 3: arrTestArray(in tSize,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
    >[/color]


    Comment

    Working...