Download MetaTrader 5
To add comments, please log in or register
Do you know that MQL5 is an object-oriented language?
Michael
28
Michael 2015.03.27 18:43 

Hello I'm trying to import a function from file1.ex4 to file2.ex4

 

 in file1.mq4 i got these lines.

double getvalue(int i)

  {

   double r;

   r = ExtATRBuffer[i];

   return(r);

  } 

 

 in file2.mq4 i got these lines.

#import "myATR.ex4"

double   getvalue(int i);

#import 

 

 When I start the project I get these messages.

unresolved import function call

Cannot find 'getvalue' in 'file1.ex4'

 

Apparently the function cannot be found, but I cannot see why (or I totally missunderstood the import function procedure).

/M

peter.MT4Web
158
peter.MT4Web 2016.07.12 20:13  

Hi!

Only exported functions can be imported from ex4 files.

Use:

double getvalue(int i) export

  {

   double r;

   r = ExtATRBuffer[i];

   return(r);

  } 


But i think your ExtATRBuffer will have no values.

/
To add comments, please log in or register