Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug when redimensioning multi-dimension arrays?
#2
yeah, don't think redim _preserve works like that

here is sure way
Code: (Select All)
Dim Grid2(1 To 5, 1 To 5)
' LoadInitialValues
For y = 1 To 5
    For x = 1 To 5
        counter = counter + 1
        Grid2(x, y) = counter
    Next
Next

ShowArrayValues Grid2()
ReDim Shared Grid(1 To 10, 1 To 10)
For y = 1 To 5
    For x = 1 To 5
        Grid(x, y) = Grid2(x, y)
    Next
Next

ShowArrayValues Grid()
End



Sub ShowArrayValues (arr())
    Print "Array Values:": Print
    For y = 1 To UBound(arr, 2)
        Print Using "Row ##  "; y,
        For x = 1 To UBound(arr, 1)
            Print Using " ##"; arr(x, y);
        Next
        Print
    Next
    Print
End Sub
b = b + ...
Reply


Messages In This Thread
RE: Bug when redimensioning multi-dimension arrays? - by bplus - 06-19-2024, 10:01 PM



Users browsing this thread: 9 Guest(s)