Announcement

Collapse
No announcement yet.

Using Redim Preserve with 2-d array

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using Redim Preserve with 2-d array

    Can the Redim Preserve be used with multidimensional arrays?
    I am getting an array out of bounds error when I attempt to
    Redim a two dimensional array with the Preserve option.
    *******
    Dim X(100,2)
    Redim Preserve X(200,2)
    *******

    Is this possible, or do I need to break the array into associated
    1-d arrays?

    Thanks

    David Thompson


    ------------------
    DRT
    DRT

  • #2
    David --

    Per the PB docs, when you are using REDIM PRESERVE only the outer (i.e. last) dimension can be changed.

    If possible, rework your arrays to use...
    Code:
    Dim X(2,100)
    Redim Preserve X(2,200)
    -- Eric


    ------------------
    Perfect Sync Development Tools
    Perfect Sync Web Site
    Contact Us: mailto:[email protected][email protected]</A>
    "Not my circus, not my monkeys."

    Comment


    • #3
      Thanks for the help. It will be easy to rework the array now.

      ------------------
      DRT
      DRT

      Comment

      Working...
      X