possible use of uninitialized variable "balik"

 

hello, I take that warning when I use the #property strict

what should I do?

bool Short()
   {  
      bool   flag=false;
      double balik[4], giris[4];
      int    i, limit=ArraySize(balik);
      
      for(i=0; i<limit; i++)
         {      
            balik[i]=iCustom(NULL,0,"oho",Periyot,0,i);
            giris[i]=iCustom(NULL,0,"oho",Periyot,1,i);             
         }

      if (  balik[1]  >= Level      &&  
            giris[1]  >= Level      &&
            balik[1]  <  giris[1] && 
            balik[2]  >  giris[2]  )
            {
             flag=true;
            } 
      return(flag);
   }
 
Yasir Kidil:

hello, I take that warning when I use the #property strict

what should I do?

Use: ArrayInitialize for both balik and giris.
 
Mohammad Hossein Sadeghi

I guess like this, right?

bool Short()
   {  
      bool   flag=false;
      double balik[4], giris[4];
      ArrayInitialize(balik,EMPTY_VALUE);
      ArrayInitialize(giris,EMPTY_VALUE);
      int    i, limit=ArraySize(balik);
      
      for(i=0; i<limit; i++)
         {      
            balik[i]=iCustom(NULL,0,"oho",Periyot,0,i);
            giris[i]=iCustom(NULL,0,"oho",Periyot,1,i);             
         }

      if (  balik[1]  >= Level      &&  
            giris[1]  >= Level      &&
            balik[1]  <  giris[1] && 
            balik[2]  >  giris[2]  )
            {
             flag=true;
            } 
      return(flag);
   }
 
Yasir Kidil:

I guess like this, right?

Yes, you should receive no warning.

 
Mohammad Hossein Sadeghi:

Yes, you should receive no warning.

thank you, I tried and no warning

Reason: