Passing arrays between functions

 
Hi,

I am trying to pass arrays between function calls in my EA.

Here is the structure for my program.

I have the following files.

Helper.mq4
void writeLog(string[] orderLog)
{

   orderLog[0] = "Text1";
   orderLog[1] = "Text2";
   orderLog[2] = "Text3";

}



Helper.mqh

void writeLog(string[] orderLog);



EA.mq4


#include <Helper.mqh>

string OrderLog[24] = {"","","","","","","","","","","","","","","","","","","","","","","",""};

int init()
{

   writeLog(OrderLog);

   return(0);
}



When I run the above snippet of code, I get the following errors:

',' - left square parenthesis expected for array
',' - parameter expected
',' - incompatible types


However, if I do not use libraries and place these functions into the EA.mq4 file itself, the code works.

Does anyone know how to pass functions between functions in another library?

Your help would be much appreciated.

Thanks
syrndr

 
Hello syrndr

Have you read MetaEditor help documents?
very important to understand structure of MQL4 program...
also read some existing code - eg, examples which come with MT install.
Above will give you 'feel' for things.

VIP resource is: "MQL4: automated forex trading"

Please take time to read and learn - I guarrantee you will reap the benefits of time well spent now in this pursuit!

Good luck.
Reason: