式の計算結果の真偽で条件分岐を行う
If(Expression)
| Expression | 式。式の説明参照。 |
式の内容が真偽値として判断され、真(True)である場合、次の行のコマンドもしくはブロックが実行される。
次の行のコマンドもしくはブロックの後にElseに続いてコマンドもしくはブロックがあれば、儀(False)であった場合に実行される。
式の説明, Var:=式, if var in/contains MatchList, if var between, IfInString, Blocks, Else
if (A_Index > 100 or Done)
return
if (A_TickCount - StartTime > 2*MaxTime + 100)
{
MsgBox Too much time has passed.
ExitApp
}
if (Color = "Blue" or Color = "White")
{
MsgBox The color is one of the allowed values.
ExitApp
}
else if (Color = "Silver")
{
MsgBox Silver is not an allowed color.
return
}
else
{
MsgBox This color is not recognized.
ExitApp
}