Please check this document,
https://docs.mql4.com/basis/variables/extfunctions
- If there is a need to pass data of the int or double type, then the one-dimensional array of the corresponding type should be passed by reference as a parameter.
![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
I use MT4 Version: 4.00 Build 225. Something doesn't work using library. I can state easy example :
\experts\libraries\
------------------------------- test.mq4 -----------------------
#property library
void foo1(int& ret)
{
ret=123;
}
void foo2(int& ret[])
{
ret[0]=123;
}
------------------------------------------------------------------
\experts\include\
------------------------------- test.mqh -----------------------
#import "test.ex4"
void foo1(int& ret);
void foo2(int& ret[]);
------------------------------------------------------------------
\experts\scripts\
------------------------------- testing.mq4 --------------------
#include <test.mqh>
int start()
{
int numb;
int arr[1];
foo1(numb);
foo2(arr);
Alert(numb," ",arr[0]," Why is the constant bad (result=0) and the array OK (result=123) ?");
}
------------------------------------------------------------------
It takes me considerable time to discover the bug. I prefer using arrays. May be it helps somebody....
If it is my fault, sorry for misinform. Who can explain it ?
Thanks
Ron