Conditional Statements

A conditional statement is the one whose running depends on sum conditions.

The structure of such statements are bound with If, Then, Else and Endif keywords.

If <Conditions> Then
    .......
    .......
    .......
Else
    .......
    .......
    .......
Endif


 

Note:

Look at the following example:

Integer i , j , k

i = 5

If i>3 Then
    j = i * 2
    k = i + 6
Else
    j = i + 10
    k = i * 3
Endif

 

 

More Complex Conditions:

Two conditions may be combined using "And" and "Or" to make more complex conditions.

    Look at the following example:

Integer i , j , k

i = 5
j = 3
If i>3 And j<8 Then
    k = i + 6
Else
    k = i * 3
Endif

 

 

Recall:

"And" combinations are true when: both conditions are true.
"And" combinations are false when only one condition is false.
                                  
"Or" combinations are true when only one condition is true.
"Or" combinations are false when: both conditions are false.