Snelle Moda:
Hi all.
I have a mqh file with this example.
When I compile this code in MT4, the compiler gives the error: "'i' - variable already defined"
But when I compile this in MT5 everything is oke. Why does the MT4 compiler generate this error and the MT5 compiler not.
The "i" variable is declared inside the loops, so they should only be visible inside the loop not outside.
Does anyone know why?
Add this to your mql4 code
#property strict
It works.
Thanks Alain, you are my Hero!

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
Hi all.
I have a mqh file with this example.
When I compile this code in MT4, the compiler gives the error: "'i' - variable already defined"
But when I compile this in MT5 everything is oke. Why does the MT4 compiler generate this error and the MT5 compiler not.
The "i" variable is declared inside the loops, so they should only be visible inside the loop not outside.
Does anyone know why?