Support

Equilla Formula Language

CopyArray

Copies some or all elements from one array to another. If the target array is dynamic, it will get resized if necessary to hold all copied elements.

Inputs

SourceArray
Array: The array to copy from.
SourceStart
Numeric: The index of the first element to copy.
TargetArray
ArrayRef: The array to copy to.
TargetStart
Numeric: The index of the first element that gets overwritten in the target array.
NumElements
Numeric: The number of elements to copy.

Examples

Copy the last two elements from one array to another
Arrays: myTargetArray[4], mySourceArray[3]; FillArray(mySourceArray, 3, 2, 1); FillArray(myTargetArray, 1, 2, 3, 4); CopyArray(mySourceArray, 2, myTargetArray, 3, 2); print(myTargetArray); // prints 1 2 2 1
Copy the whole array
Arrays: myTargetArray[4], mySourceArray[3]; FillArray(mySourceArray, 3, 2, 1); FillArray(myTargetArray, 1, 2, 3, 4); CopyArray(mySourceArray, myTargetArray); print(myTargetArray); // prints 3 2 1 4