D Documentation  
If statement
if ( /* boolean expression*/ )
  statement;
// Optional:
else
  statement;

"If" executes the next statement only if the boolean expression evaluates to "true". If there is an "else" block, it gets executed if the expression evaluates to "false".
The statements that are executed are often block statements.

Example:
if (i == 4)
{
  writef("i is equal to 4");
} else {
  writef("i is not equal to 4");
}


It is also possible to make multiple constructs of if-else, they work as you expect them to work:

if(i == 4) 
{
  // code for i == 4
}
else if(i == 5)
{
  // code for i == 5
}
else
{
  // code for any other i
}
Created using PHP docwiki written by Markus Dangl. Best viewed with Mozilla Firefox.