EmptySpace Posted June 22, 2012 Posted June 22, 2012 (edited) Im lost... I want to use multiple checked boxes and get words. expandcollapse popupWhile 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Show msgbox(0,"",$word1) msgbox(0,"",$word2) and so on to see if it works..? Case $Read ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; If GUICtrlRead ($Checkbox1) = 1 Then Dim $word1 ="text1" If GUICtrlRead ($Checkbox2) = 1 Then $word2 ="text2" If GUICtrlRead ($Checkbox3) = 1 Then $word3 ="text3" If GUICtrlRead ($Checkbox4) = 1 Then $word4 ="text4" If GUICtrlRead ($Checkbox5) = 1 Then $word5 ="text5" If GUICtrlRead ($Checkbox6) = 1 Then $word6 ="text6" If GUICtrlRead ($Checkbox7) = 1 Then $word7 ="text7" If GUICtrlRead ($Checkbox8) = 1 Then $word8 ="text8" If GUICtrlRead ($Checkbox9) = 1 Then $word9 ="text9" Endif Endif Endif Endif Endif Endif Endif Endif Endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; EndSwitch WEnd Maybe I badly used If's? Also I want if checkbox isnt checked then do nothing (dont return/declare variable). If i want to get 1 variable from first checkbox then i get it but cant get other.... Edited June 22, 2012 by Edgaras
somdcomputerguy Posted June 22, 2012 Posted June 22, 2012 Does it work with this modification? Using nested If's is a bad idea here, if (no pun intended) the first one is false, none of the others will be processed. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; If GUICtrlRead ($Checkbox1) = 1 Then $word1 ="text1" If GUICtrlRead ($Checkbox2) = 1 Then $word2 ="text2" If GUICtrlRead ($Checkbox3) = 1 Then $word3 ="text3" If GUICtrlRead ($Checkbox4) = 1 Then $word4 ="text4" If GUICtrlRead ($Checkbox5) = 1 Then $word5 ="text5" If GUICtrlRead ($Checkbox6) = 1 Then $word6 ="text6" If GUICtrlRead ($Checkbox7) = 1 Then $word7 ="text7" If GUICtrlRead ($Checkbox8) = 1 Then $word8 ="text8" If GUICtrlRead ($Checkbox9) = 1 Then $word9 ="text9" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
EmptySpace Posted June 22, 2012 Author Posted June 22, 2012 Wow, thanks it works. Talking about If's I can use it without endif? For example If stringinstr() then...? Or only with " = 1"," = 0" things?
AdmiralAlkex Posted June 22, 2012 Posted June 22, 2012 Wow, thanks it works. Talking about If's I can use it without endif? For example If stringinstr() then...?Or only with " = 1"," = 0" things?They both end up as If False or If True, what you are comparing doesn't matter. If is If.Singleline Ifs have no EndIf (they would be multiline then...), multiline have them. There are no more to it. See If in helpfile. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
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