Array copying

Situation: 

You want to do something with an array that will change it, like sort it. You want the original array as well.

Actions: 

Make a copy of the array. Mess with the original or the copy.

Explanation: 

Code to sort an array.

  1. Sub copyArray(ByRef sourceArray, ByRef destinationArray)
  2.     Dim index As Integer
  3.     For index = LBound(sourceArray) To UBound(sourceArray)
  4.         destinationArray(index) = sourceArray(index)
  5.     Next index
  6. End Sub