Download MetaTrader 5

What my easy code 's error,two value compare

To add comments, please log in or register
47803124
160
47803124  
Look last Code ,why the run ruzult is  ok2    not  ok3?
  double a=4.0;
      double    b=4.5;
      if(a>b)  Alert("ok1");
      if(a<b)  Alert("ok2");
      if(a==b) Alert("ok3");



 double a=4.0;
      int b=4;
      if(a>b)  Alert("ok1");
      if(a<b)  Alert("ok2");
      if(a==b) Alert("ok3");






           int MAINX= FileOpen("MAIN2222.TXT", FILE_COMMON|FILE_CSV|FILE_READ|FILE_WRITE);
           FileWrite(MAINX,4);  
           FileSeek(MAINX, 0, SEEK_SET);
           FileClose(MAINX);
//That's mean is write  a text  and write integer 4

   
           int MAINX= FileOpen("MAIN2222.TXT", FILE_COMMON|FILE_CSV|FILE_READ|FILE_WRITE);
           FileSeek(MAINX,0,SEEK_SET);
           double a=FileReadNumber(MAINX);  //这里的方向只代表了美元的多头方向
           FileClose(MAINX);
      //Read the double  a=4
           int b=4;
        
      
          if(a>b)  Alert("ok1");
          if(a<b) Alert("ok2");
         if(a==b) Alert("ok3"); 
Look last Code ,why the run result sometimes is  ok2    not  ok3? WHY
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI  
Print() the result and see what is the value for a.
whroeder1
15598
whroeder1  
zdj231: ,why the run ruzult is  ok2    not  ok3?
The == operand. - MQL4 forum
To add comments, please log in or register