Download MetaTrader 5

expression has no effect

To add comments, please log in or register
Interested in MetaTrader 5 features? Learn more about them!
Michael
685
Michael 2014.03.07 20:47 

I'm getting this warning on this line of code:

intCount[intArrayElement++];

Now, I know this gives me the desired affect; it worked in prior builds of MT4. I'm just using an array to count the number of instances of patterns.

It's just a warning, but an odd one. Why?

Toast
226
Toast 2014.03.07 20:54  

Maybe try splitting it:

intArrayElement++;

intCount[intArrayElement];

Take a look here: https://docs.mql4.com/basis/operations/mathoperation

The prefix increment (++i) and decrement (--k) are applied to the variable right before this variable is used in an expression.

Post-increment (a++) and post-decrement (k--) are applied to the variable right after this variable is used in an expression.

Michael
685
Michael 2014.03.07 21:43  
Thanks toast. But I figured it out; I typed it wrong. It's supposed to be: intCount[intArrayElement]++;
To add comments, please log in or register