redim preserve error

Results 1 to 2 of 2

Thread: redim preserve error

  1. #1
    Join Date
    Dec 1969

    Default redim preserve error

    I am getting a subscript out of range error when I try to redim preserve an array. If I take the preserve keyword out it works fine but then I obviously loose the existing data. Looking at the code below can anyone see what I am doing that would cause the subscript out of range error. The error message says it is happening on the line that says: ReDim preserve array2(i,j)<BR><BR>thanks Jason<BR><BR>i = 1<BR>j = 3<BR>ReDim array2(i,j)<BR>For Each item In Request.form <BR> array1 = split(item, "_") <BR> if array1(0) = "txtStepno" then<BR> i = i + 1 <BR> ReDim preserve array2(i,j)<BR> array2(i,0) = Request.form(item) <BR> end if <BR>next

  2. #2
    Join Date
    Dec 1969

    Default RE: redim preserve error

    check the manual out concerning Preserve. You can only preserve the last dimension in an array.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts