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. |
If statements may be nested.
The expression can contain the boolean operators of And, Or, and Not as well as the logical operators <, <=, >, >=, =, ==, and <> grouped with parentheses as needed.
If...Then, Select...Case...EndSelect, Switch...EndSwitch, Ternary
#include <MsgBoxConstants.au3>
Local $sString = ""
If $sString > 0 Then
MsgBox($MB_SYSTEMMODAL, "", "Value is positive.")
ElseIf $sString < 0 Then
MsgBox($MB_SYSTEMMODAL, "", "Value is negative.")
Else
If StringIsXDigit($sString) Then
MsgBox($MB_SYSTEMMODAL, "", "Value might be hexadecimal!")
Else
MsgBox($MB_SYSTEMMODAL, "", "Value is a string.")
EndIf
EndIf