• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 151
  • Last Modified:

Copying arrays

Is there any command used to copy arrays?  Like in HP BASIC you can use a MAT Array_a = Array_b. I would prefer not to use a for..next loop to go through each element and copy them.
1 Solution
This is where a variant comes in real handy. Here is an example of how to copy an array:

Private Sub Command1_Click()
    Dim aArray
    Dim aArray2
    ReDim aArray(0 To 10, 0 To 10)
    Dim i As Integer
    Dim j As Integer
    For i = 0 To 10
        For j = 0 To 10
        aArray(i, j) = i * j
        Next j
    Next i
    aArray2 = aArray
End Sub

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now