If
Then
Else
End If
|
condition
|
|
Any expression that evaluates to TRUE or FALSE
|
|
statement, statements
|
|
Statement(s) executed if condition is TRUE.
|
|
elsestatement, elsestatements
|
|
Statement(s) executed if condition is FALSE.
|
When executing If, condition is tested. If condition is TRUE, the statements following Then are executed. If condition is FALSE, the statements following Else are executed. After executing the statements following Then or Else, execution continues with the statement following End If.
|
|
|
If a = 0 Then print "OK"
|
|
If (a = 0) or (b = 0) Then c = c - 1 Else c = c + 1
|
|
if a = 0 Then
|
b = 0
|
c = 0
|
Else
|
b = 1
|
c = 1
|
End IF
|
|
You can nest If statements by placing one If within another:
|
|
if a = 0 Then
|
If b = 0 Then
|
c = 0
|
Else
|
c = 1
|
End IF
|
End IF
|
|