Keyword Reference

If...Then

Conditionally run a single statement.

If <expression> Then statement

 

Parameters

expression If the expression is true, the statement is executed.

 

Remarks

This version of the If statement is used to execute a single statement without the overhead of an EndIf.
The expression can contain the boolean operators of AND, OR, and NOT as well as the logical operators <, <=, >, >=, =, ==, and <> grouped with parentheses as needed.

 

Related

If...Else...EndIf, Select...Case...EndSelect, Switch...EndSwitch

 

Example


;Terminates script if no command-line arguments
If $CmdLine[0] = 0 Then Exit

;Alternative:
If $CmdLine[0] = 0 Then
    Exit
EndIf