AutoIt:循环结构

For…Next

#cs----------------------------------
; 语法说明
For <控制变量> = <初始值> To <终值> [Step <步长>]
    循环体语句
    ...
Next
#ce----------------------------------

For $i = 3 to 1 Step -1
    MsgBox(0, "For...Next", $i)
Next

While…WEnd

#cs----------------------------------
; 语法说明
While <循环控制表达式>
    循环体语句
    ...
WEnd
#ce----------------------------------

$i = 0
While $i <= 3
    MsgBox(0, "While...WEnd", $i)
    $i = $i + 1
WEnd

Do…Until

#cs----------------------------------
; 语法说明
Do
    循环体语句
    ...
Until <循环控制表达式>
#ce----------------------------------

$i = 0
Do
    MsgBox(0, "DO...Until", $i)
    $i = $i + 1
Until $i = 3

你可能感兴趣的:(AutoIt)