When using the Debugger the code is automatically compiled using #property strict, even if it doesn't exist in the code.
Without #property strict (old behavior) you don't get this "array out of range" error.
angevoyageur:
When using the Debugger the code is automatically compiled using #property strict, even if it doesn't exist in the code.
Without #property strict (old behavior) you don't get this "array out of range" error.
AAHHH!
And I cannot define a 'no_strict' for the debugger - correct?gooly:
Excat, you can't
AAHHH!
And I cannot define a 'no_strict' for the debugger - correct?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,
I was looking at the source code of the Traders Dynamic Index.
First of all I cannot start this indicator by the debugger (- the green button is grey and so disabled??)
BUT I can attach it to a chart and it works perfectly!!
OK - Now I did this:
1) I saved the source code under a different name tdi_test.mq4 and I compiled it - no error, no warning :)
2) The debugger-button becomes green :))
3) I attached it to a chart - no problem, no array out of range :))))
4) I place a breakpoint at the first line after:
Beside my breakpoint everything else is nothing but the original code!!
5) I start the indicator by debugger:
1st loop: Bars=33298, i=33297, x=33297
2nd loop-1: Bars=33298, i=33297, x=33298
and NOW I do get the (expected!!) array out of range.
(The RSIBuff is the first indicator buffer (size=Bars), the RSI array has the size of Volatility_Band)
As x-1=1 only the RSIBuff[x] is out of range - ok.
BUT WHY this code works if it not running in the debugger and why?
Ans NOW it does not work any more at a chart - its window is just empty.
Ok I removed it from the chart and re-applied it but I do get the array-out-of-range error and the indicator isn't working anymore.
Is it a hidden feature of the mt4 to tolerate initial array out of ranges?
Hard to understand the logic behind it!
For financial software one should stick to a kind of no-error-tolerance, it could become dangerous otherwise and you don't know when!