Array Copy

From MultiCharts
Jump to: navigation, search

Copies a specified number of elements from the specified one-dimensional source array, starting at the specified source index; the elements are copied to the specified one-dimensional destination array, starting at the specified destination index. Source and destination can be the same array as well as two different arrays.

Usage

Array_Copy(SourceArray,SourceIndex,DestinationArray,DestinationIndex,NumberOfElements)

Where:

SourceArray - an expression specifying the name of the source array
DestinationArray - an expression specifying the name of the destination array
SourceIndex - a numerical expression specifying the starting index for the source array
DestinationIndex - a numerical expression specifying the starting index for the destination array
NumberOfElements - a numerical expression specifying the number of elements to copy

Example

Copy from Array1 the two-element segment beginning at the index of 4, to the Array2, beginning at the index of 6:

Array_Copy(Array1,4,Array2,6,2);

Copy from Array1 the two-element segment beginning at the index of 4, to the same array, beginning at the index of 6:

Array_Copy(Array1,4,Array1,6,2);