If Statement Definitions
Previous Topic  Next Topic 

The if_statement allows code to be executed only if a certain condition holds true.  The syntax of the if_statement is as follows:


if ( expr )

     statement_block

{ else

   statement_block  }

endif


If the conditional expression, expr, evaluates to a non-zero value then the statement_block after the if is executed.      If the expr evaluates to zero then if there is an else statement then the statement_block after the else is executed otherwise execution jumps to the endif statement.