Download MetaTrader 5

expression has no effect

To add comments, please log in or register
Michael
718
Michael  

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  

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
718
Michael  
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