Conditionally run statements.
If <expression> Then
statements
...
[ElseIf expression-n Then
[elseif statements ... ]]
...
[Else
[else statements]
...
EndIf
| expression | If the expression is true, the first statement block is executed. If not, the first true ElseIf block is executed. Otherwise, the "Else" block is executed. |
Local $var = ""
If $var > 0 Then
MsgBox(4096, "", "Value is positive.")
ElseIf $var < 0 Then
MsgBox(4096, "", "Value is negative.")
Else
If StringIsXDigit($var) Then
MsgBox(4096, "", "Value might be hexadecimal!")
Else
MsgBox(4096, "", "Value is a string.")
EndIf
EndIf