ArrayCopy

2019/07/17 19:00
64

int ArrayCopy(object &dest[], object source[], int start_dest=0, int start_source=0, int count=WHOLE_ARRAY)

配列を他の配列にコピーする。配列同士は同じ型でなければならないが、double[]、int[]、datetime[]、color[]、bool[]型は同じ型としてコピーされる。
コピーされた要素数を返す。

Parameters:
dest[] - コピー先の配列
source[] - コピー元の配列
start_dest - コピー先の配列の開始インデックス。デフォルトでは0
start_source - コピー元の配列の開始インデックス。デフォルトでは0
count - コピーする要素数。デフォルトでは全要素
Sample:
double array1[][6];
double array2[10][6];
// array2 is filled with some data
ArrayCopyRates(array1);
ArrayCopy(array2,array1,0,0,60);
// array2 is having the first 10 bars from the history now
//(first bar considered as bar with index [Bars-1])
ArrayCopy(array2,array1,0,Bars*6-60,60);
// array2 is having the last 10 bars from the history now
//(last bar considered as current bar, bar wit index [0])

コメント