Zithen Posted November 14, 2005 Share Posted November 14, 2005 have this gui has 2 for loops, the frist one work great, but down in the case statment for hitting $DelBtnGo it will do the first msg box but never enter the for loop or just by passes it. I tried a few options but get the same results... if someone can take a look and let me know what i screwed up that would be great thanks expandcollapse popupGlobal $name Global $check[20] Global $delini Global $x = 10 Global $y = 30 $name = IniReadSectionNames($file) If @error Then MsgBox(48, "Error", "Error: Can not read save file." & @CR & @CR & "Error: 1084") Else GUICreate("Delete Printers", 400, 230) For $i = 1 To $name[0] $name1 = IniRead($file, $name[$i], "name", "null") $check[$i] = GUICtrlCreateCheckbox($name1, 10, $y, 200, 10) $y = $y + 20 Next $DelLbl = GUICtrlCreateLabel("Please check the printers you would like to delete.", 80, 10, 250, 20) $DelBtnAll = GUICtrlCreateButton("Delete All", 100, 190, 70, 30) $DelBtnGo = GUICtrlCreateButton("Delete Selected", 210, 190, 85, 30) EndIf GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $DelBtnAll deleteallprinters() Case $msg = $DelBtnGo MsgBox(0,"test","1") For $i = 1 To $check[0] MsgBox(0,"test","2") $chb_state = GUICtrlRead($check[$i]) msgbox(0,"test",$chb_state) If $chb_state = $GUI_CHECKED Then MsgBox(0, "staus", "deleting" & $name[$i]) Else MsgBox(0, "staus", "not deleting" & $name[$i]) EndIf Next EndSelect WEnd Exit Link to comment Share on other sites More sharing options...
Developers Jos Posted November 14, 2005 Developers Share Posted November 14, 2005 have this gui has 2 for loops, the frist one work great, but down in the case statment for hitting $DelBtnGo it will do the first msg box but never enter the for loop or just by passes it. I tried a few options but get the same results...if someone can take a look and let me know what i screwed up that would be great thanks What is the value of $check[0], don't see you setting it anywhere ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Zithen Posted November 14, 2005 Author Share Posted November 14, 2005 see i knew i screwed up lol i didint have it set...just added a simplie $check[0] = $i - 1 after my next statement and works like a charm lol. thx JdeB Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now