Download MetaTrader 5

How the Program Flow? - page 2

To add comments, please log in or register
chua le
235
chua le  

Dear WHRoeder,

 

As I am new to MQL4 so sometimes  I will ask too basic questions, hope you dont mind. I did compile the progeam and I dont know why it display an error.

darksideofthemoon
57
darksideofthemoon  
chuale:

As I am new to MQL4 so sometimes  I will ask too basic questions, hope you dont mind. I did compile the progeam and I dont know why it display an error.

It displays an error because it seems that "not all control paths return a value" is an error now and not a warning anymore. - Just put a  

return 0;

statement as the last statement in start().

In general, if a function is declared and/or defined to return a value (non void function), then it has to do so.

And if you want to code in mql you basically need to know how to code in c++, since mql is a subset of c++, where all of the program flow, declarations and definitions etc are virtually the same.

Read the book: https://book.mql4.com/

12
To add comments, please log in or register