Download MetaTrader 5

Compare ever element in an array to a static value?

To add comments, please log in or register
flwilliams87
222
flwilliams87  
Is there a way for me to compare every element of an array with a static value via an IF statement? I don't think ArrayCompare works for this.  Thanks
Marco vd Heijden
Moderator
5489
Marco vd Heijden  

in a for loop with the if statement == is equal to.

  
   for(int i=0;i<total_elements;i++)
    {
     if(array_here[i]==value_here)
      {
       //Do something.
      }
    }
flwilliams87
222
flwilliams87  
Marco vd Heijden:

in a for loop with the if statement == is equal to.

Very good sir! Thank you!
To add comments, please log in or register