4-2 If...else 语句

if(表达式)
指定在表达式,计算结果为 TRUE 时执行的命令.

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
}

你可能感兴趣的:(4-2 If...else 语句)