错误:在赋值语句中期望“=”运算符

时间:2016-02-21 18:30:03

标签: autoit

Func trigger_gui_()
    $guiG = WinGetPos($d3d)
    If GUICtrlRead($1s) = "On" Then
        $arr[8] = [$1, $1s, $af, $afs, $ms, $mss, $tk, $tkk]

        For $i = 0 to 8 + 1 
            $var = ControlGetPos( "Crypt3x", "", $arr[$i] )
            $math = $var[3] - 17
            GUICtrlSetPos($arr[$i], 104, $guiG[3] - $math, 80, 17)
        Next
    EndIf
EndFunc

我在此功能中遇到上述错误 有人可以帮助我:|

2 个答案:

答案 0 :(得分:1)

如果错误在此代码中,那么它就是数组的范围。除非您更改数组,否则数组从0开始,而不是从1开始。

Func trigger_gui_()
    $guiG = WinGetPos($d3d)
    If GUICtrlRead($1s) = "On" Then
        $arr[8] = [$1, $1s, $af, $afs, $ms, $mss, $tk, $tkk]

        For $i = 0 To 7 
            $var = ControlGetPos("Crypt3x", "", $arr[$i])
            $math = $var[3] - 17
            GUICtrlSetPos($arr[$i], 104, $guiG[3] - $math, 80, 17)
        Next
    EndIf
EndFunc

答案 1 :(得分:0)

将您的数组声明为全局。这可能有助于解决问题。