Array_Copy (Reserved Word)
This reserved function copies NumElements elements from the dynamic array identified by SrcArrayName starting with the element at SrcElement and copies them to the array identified by DestArrayName starting with the element at DestElement. The SrcArrayName and DestArrayName can be the same value and in the case of an overlap this function will ensure that the original source elements are copied before being overwritten.
Usage
Array_Copy(SrcArrayName, SrcElement, DestArrayname, DestElement, NumElements);
Return
A value of 0 will be returned if the copy is successful, otherwise one of the following values will be returned
-1 - Unknown error
-2 - Invalid ScrArrayName of DestArrayName
-3 - Invalid SrcElement or DestElement
-4 - Destination array is different type than source array
-5 - Invalid or out of range NumElements
Parameters
Name | Description |
SrcArrayName | Name that identifies the dynamic array to copy from and is the name given in the array declaration |
SrcElement | An integer representing the starting element to begin copying from in the source array. |
DestArrayName | Name that identifies the dynamic array to copy to and is the name given in the array declaration |
DestElement | An integer representing the starting element to begin copying to in the destination array. |
NumElements | An integer representing the number of elements to copy. |
Examples
Copies a range of 12 array elements from element 5 of the first dynamic array to element 8 of a second dynamic array.
Array_Copy(FirstArray, 5, SecondArray, 8, 12);