malumuc: A careless substitution resulted in code that I was able to reduce to this:
void Test() { bool b; b[ = true; if (b[) { b[ = false; } }
1. the code is compiled without errors.
2. it is executed without error.
3. in the debugger after the assignment b[ is displayed as true.
4. the "if" on the other hand is never entered.
In my original EA code, this proved to be a killer. It gave completely different results... because the "if" never occurred.
Am I missing something here? Is there a mysterious [-operator or is this just a bug?
Very strange indeed. It seems to be a bug in the MetaEditor at the very least.
However, please edit your original post and replace your code properly (with "</>" or Alt-S), for easier viewing (as I have done above in quoting your post).
- malumuc: 1. the code is compiled without errors.Not on MT4 (build 1370) (editor build 2402)
void Test() { bool b; b[ = true; // '[' - array required testscr.mq4 858 6 // expression has no effect testscr.mq4 858 5 if (b[) { b[ = false; } } // '}' - unexpected end of program testscr.mq4 863 3
-
Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
Messages Editor
Yes, but on MQL5 (MetaEditor 5 build 3550) it compiles without errors or warnings ...
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
A careless substitution resulted in code that I was able to reduce to this:
void Test() {
bool b;
b[ = true;
if (b[) {
b[ = false;
}
}
1. the code is compiled without errors.
2. it is executed without error.
3. in the debugger after the assignment b[ is displayed as true.
4. the "if" on the other hand is never entered.
In my original EA code, this proved to be a killer. It gave completely different results... because the "if" never occurred.
Am I missing something here? Is there a mysterious [-operator or is this just a bug?