JLC123 Posted November 2, 2007 Share Posted November 2, 2007 MyGUI has 1 checkbox and 2 input boxes - I need to make sure that all three have data before running the script. I know this is probably unbearably basic coding, so forgive me for asking but . . . Can anyone fix my check input section please? expandcollapse popupWhile 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Select Case $msg = $byebutton; Exit Exit Case $msg = $FirstButton; Select If GUICtrlRead($FirstButton) = $GUI_CHECKED Then GUICtrlSetState($SecondButton, $GUI_DISABLE) $item_checked = 1 Else GUICtrlSetState($SecondButton, $GUI_ENABLE) EndIf Case $msg = $SecondButton; Select If GUICtrlRead($SecondButton) = $GUI_CHECKED Then GUICtrlSetState($FirstButton, $GUI_DISABLE) $item_checked = 1 Else GUICtrlSetState($FirstButton, $GUI_ENABLE) EndIf Case $msg = $okbutton; GO! ;Check for input If $item_checked = 0 Then MsgBox(16, "ERROR", "Please Select Check Box") EndIf If GUICtrlRead($Check1) = 0 Then MsgBox(16, "ERROR", "Please Enter #1 Input") EndIf If GUICtrlRead($Check2) = 0 Then MsgBox(16, "ERROR", "Please Enter #2 Input") Else Get_Data() EndIf EndSelect WEnd Two wrongs don't make a right, but three lefts do Link to comment Share on other sites More sharing options...
rasim Posted November 2, 2007 Share Posted November 2, 2007 expandcollapse popupWhile 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Select Case $msg = $byebutton; Exit Exit Case $msg = $FirstButton; Select If GUICtrlRead($FirstButton) = $GUI_CHECKED Then GUICtrlSetState($SecondButton, $GUI_DISABLE) $item_checked = 1 Else GUICtrlSetState($SecondButton, $GUI_ENABLE) $item_checked = 0 EndIf Case $msg = $SecondButton; Select If GUICtrlRead($SecondButton) = $GUI_CHECKED Then GUICtrlSetState($FirstButton, $GUI_DISABLE) $item_checked = 1 Else GUICtrlSetState($FirstButton, $GUI_ENABLE) $item_checked = 0 EndIf Case $msg = $okbutton; GO! ;Check for input If $item_checked = 0 Then MsgBox(16, "ERROR", "Please Select Check Box") ContinueLoop EndIf If GUICtrlRead($Check1) = 0 Then MsgBox(16, "ERROR", "Please Enter #1 Input") ContinueLoop EndIf If GUICtrlRead($Check2) = 0 Then MsgBox(16, "ERROR", "Please Enter #2 Input") ContinueLoop EndIf Get_Data() EndSelect WEnd Link to comment Share on other sites More sharing options...
JLC123 Posted November 2, 2007 Author Share Posted November 2, 2007 Thanks! Two wrongs don't make a right, but three lefts do 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