Sample
double Array1[100]; // add value inside the Array1 and so on..... // call the ArrayDisplay function and pass the Array as a parameter variable of the function //function and accept the variable parameter void ArrayDisplay(double & Array[]) { string DisplayList=""; for(int i=0;i<ArraySize(Array);i++) { DisplayList=DisplayList+" "+DoubleToStr(Array[i],0); Array[i] = Array[i] + 2.0; } Comment("Array1 Display\n",DisplayList); }
Rosh:
Sample
Thanks Rosh
rgsd bob
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Dear All,
How to pass an array as a parameter variable of the function ?
I try like the example below, am I right ? example :
double Array1;
// add value inside the Array1 and so on.....
// call the ArrayDisplay function and pass the Array as a parameter variable of the function
ArrayDisplay(Array1);
//function and accept the variable parameter
void ArrayDisplay(array ArrayVariable1)
{
double DisplayList="";
for(int i=0;i<ArraySize(ArrayVariable1);i++)
{
DisplayList=DisplayList+" "+DoubleToStr(Array1Variable1[i],0);
}
Comment("Array1 Display\n",DisplayList);
Delay();
}
can some ones give me the guide of the passing array as a parameter. thanks for the help.