Compiling error after update to Build 600+: not all control paths return a value (correct working function)
Two error messages when compiling old mq4:
1) The new MetaEditor gives me a function compiling error despite promise that old mq4 indicators etc. should/could work:
"not all control paths return a value"
2) Also, I had to change old mq4 extern bool vars Alert.Message into AlertMessage and Comment.Message to CommentMessage (removing the dots).
It seems to me that my old bool var notations -now- contain a "Reserved Word", though it's not in the Reserved Word list....
May be add these to the Reserved Word List on: https://docs.mql4.com/en/basis/syntax/reserved
Thank you at forhand for your reply.
Next time, please use the SRC button when you post code. Thank you.
See this article about possible errors with new mql4 : Common Errors in MQL4 Programs and How to Avoid Them
That not all control paths return a value error means there is a possible result to something in your code that you do not have covered.
It could be because you have this condition at the end of the function
if(FP_BuferUp==0&&FP_BuferDn==0&&NP_BuferUp==0&&NP_BuferDn==0&&HP_BuferUp==0&&HP_BuferDn==0&&XP_BuferUp==0&&XP_BuferDn==0){return(0);}
What happens if it gets that far and then that condition is not true ? The function has no other way to return. You could probably fix it by giving it another way out:
else return(-10); //error
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Two error messages when compiling old mq4:
1) The new MetaEditor gives me a function compiling error despite promise that old mq4 indicators etc. should/could work:
"not all control paths return a value"
2) Also, I had to change old mq4 extern bool vars Alert.Message into AlertMessage and Comment.Message to CommentMessage (removing the dots).
It seems to me that my old bool var notations -now- contain a "Reserved Word", though it's not in the Reserved Word list....
May be add these to the Reserved Word List on: https://docs.mql4.com/en/basis/syntax/reserved
Thank you at forhand for your reply.