Nested if-else Statements in X++: Syntax and Examples

Rumman Ansari   Software Engineer   2024-07-09 04:14:29   6935  Share
Subject Syllabus DetailsSubject Details
☰ TContent
☰Fullscreen

Table of Content:


Syntax


if(bool expression){
    if( bool expression)
  {
  // Statements
  }
  else {
   // Statements
  }
}
else 
{
   if( bool expression)
  {
  // Statements
  }
  else {
   // Statements
  }
} 


if statement Example


 
// nested if else decision making example x++

static void Examples(Args _args)
{
      int a = 3;
      int b = 1;

      if( a == 3 )
	  {
         if( b == 1 ) // this is nested if
         {
           info("a = 3 and b = 1 ");
         }
      }
      else
      {
	   info("a != 3 and b != 1 ");
	  }

}