MQL4 Reference
Array functions
ArrayInitialize
| int ArrayInitialize( |
void array[], double value) |
Sets all elements of a numeric array to the same value. Returns the count of initialized elements.
Note: It is not recommended to initialize index buffers in the custom indicator init() function
as such functions are initialized automatically with an "empty value"
at allocation and re-allocation of buffers.
Parameters:
| array[] |
- |
Numeric array to be initialized. |
| value |
- |
New value to be set. |
Sample:
//---- initializing of all array elements with 2.1
double myarray[10];
ArrayInitialize(myarray,2.1);
|
|
|