int ArrayCopy(void dest[ ], object source[ ], int start_dest=0, int start_source=0, int count=WHOLE_ARRAY)
Copies an array to another one. Arrays must be of the same type, but arrays with type double[], int[], datetime[], color[], and bool[] can be copied as arrays of the same type.
配列を別の配列にコピーします。配列は同じ型のものにしなくてはならりません。しかし、double[ ]、int[ ]、datetime[ ]、color[
] と、bool[ ] の配列は、同じ型の配列としてコピーすることができます。
Returns the amount of copied elements.
コピーした要素の総数を返します。
Parameters:
パラメータ:
| dest[] |
- |
Destination array. コピー先の配列。 |
| source[] |
- |
Source array. コピー元の配列。 |
| start_dest |
- |
Starting index for the destination array. By default, start index is 0. コピー先の配列の開始インデックス。デフォルトでは、開始インデックスは 0。 |
| start_source |
- |
Starting index for the source array. By default, start index is 0. コピー元の配列の開始インデックス。デフォルトでは、開始インデックスは 0。 |
| count |
- |
The count of elements that should be copied. By default, it is WHOLE_ARRAY constant. コピーする必要がある要素数。デフォルトでは、WHOLE_ARRAY 定数(全配列要素)です。 |
|
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])
|