If/Else if/Else                                                                 Last updated 2010.1.18 (v1.0 Eng)

These commands will branch the flow of the program depending on whether the condition is true or false.

 

What's a Conditional Clause?

Conditional clause is a feature to perform different actions depending on whether the condition evaluates to true (condition is met) or false (condition is not met).  

Conditional clause is composed of the following 3 parts: parameter 1,  relational operator, and parameter 2 in order.   

program_condition_1.png

These are 6 types of  relational operators.

program_condition_2.png

Conditional clause can be combined into a complex conditional clause using conditional operators.  

A complex conditional clause is composed of the following 3 parts: conditional clause 1, conditional operator, conditional clause 2.

program_condition_3.png

There are 3 types of conditional operators.

program_condition_4.png

There is no limit to how many conditional clauses can be combined into one complex conditional clause.  Each conditional clause is evaluated in order, and the final value will be either "true" or "false."

 

Usage

 

Example

o      When the variable is greater than or equal to 90.

o      When the variable is greater than or equal to 50 and less than 90.

o      Other cases

program_condition_5.png