Пытаюсь сделать перебор Checkbox`ов в котором если он Check то добавить имя CheckBox`а в ListBox если не Check то пропустить.
ругается на $CheckBox[$i] не могу понять в чем дело
Код:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
$Form1 = GUICreate("Inst", 322, 261, 500, 500, BitOr($WS_BORDER, $WS_POPUP, $WS_SYSMENU,$WS_EX_TOPMOST), $WS_EX_CONTROLPARENT)
$Group1 = GUICtrlCreateGroup("so:", 8, 0, 305, 145)
$Checkbox1 = GUICtrlCreateCheckbox("1", 16, 16, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("2", 16, 40, 97, 17)
$Checkbox3 = GUICtrlCreateCheckbox("3", 16, 64, 97, 17)
$Checkbox4 = GUICtrlCreateCheckbox("4", 16, 88, 97, 17)
$Checkbox5 = GUICtrlCreateCheckbox("5", 168, 16, 97, 17)
$Checkbox6 = GUICtrlCreateCheckbox("6", 168, 40, 97, 17)
$Checkbox7 = GUICtrlCreateCheckbox("7", 168, 64, 97, 17)
$Checkbox8 = GUICtrlCreateCheckbox("8", 168, 88, 97, 17)
$Button1 = GUICtrlCreateButton("Inst", 16, 112, 75, 25)
$Button2 = GUICtrlCreateButton("test", 96, 112, 75, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("set:", 8, 144, 305, 105)
$List1 = GUICtrlCreateList("", 16, 160, 161, 84)
;GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
Func Inst()
for $i=1 to 8
If GUICtrlRead($CheckBox[$i]) = GUI_CHECKED then GUICtrlSetData($List1,GUICtrlRead($Checkbox[$i],1))
Next
EndFunc
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Inst()
EndSwitch
WEnd
ругается на $CheckBox[$i] не могу понять в чем дело