My code is not printing on the meta trader 4.

 

Hello community, please my "else" statement is not printing on the mt4. Below is the code:


void OnStart()

  {

//---

   int x = 10;

   int y = 100;

   

   if (x == 10) {

      Print(x);

      Print("I hate Mondays");

      Print("I love Fridays"); 

      if(y == 100) {

         Print("I just printed a nested if");

      } 

    } else {

         Print("I'm printing the else");

      

    }


The "Print("I'm printing the else"); is not executing.


What could be wrong please?


Thanks. 

 
you didnt close the if 10 }
 

Because Print("I'm printing the else") works if x is not equal to 10 .

But now x is equal 10 .

 
Arash Lakzadeh:

Because Print("I'm printing the else") works if x is not equal to 10 .

But now x is equal 10

Thanks Arash;


I just figured it out. 

 
Chukwueloka Okafor-Ezisi:

Thanks Arash;


I just figured it out. 

You're welcome.

Good luck

Reason: