Search the Community
Showing results for tags 'Error Checking'.
-
I'm wanting to build in some error checking to my GUI and so far I have been able to check to see if one check box is unchecked and if the right input has been entered but what I can't seem to nail down is how to just check if all 3 check boxes are not checked. Here is the code that I have so far. #include <GUIConstants.au3> #include <IE.au3> GUICreate("Drivers/Manuals/Warranty", 280, 110) $Driver = GUICtrlCreateCheckbox("Drivers", 10, 10) GUICtrlSetState(-1, $GUI_CHECKED) $Manual = GUICtrlCreateCheckbox("Manual", 80, 10) $Warranty = GUICtrlCreateCheckbox("Warranty", 150, 10) GUICtrlCreateLabel("Service Tag #:", 10, 45) $Input = GUICtrlCreateInput("", 90, 40) GUICtrlSetState(-1, $GUI_FOCUS) $Submit = GUICtrlCreateButton("Submit", 40, 70, 50) $Exit = GUICtrlCreateButton("Cancel", 150, 70, 50) Local $aAccelKeys[1][2] = [["{ENTER}", $Submit]] GUISetAccelerators($aAccelKeys) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Submit $CBStatus = GUICtrlRead($Driver) If $CBStatus = $GUI_UNCHECKED Then MsgBox(0, "Error", "Pleaes make a selection first") $serv_tag = GUICtrlRead($Input) if not StringRegExp($serv_tag, "^([a-zA-Z0-9]{4}|[a-zA-Z0-9]{6})1$") Then MsgBox(0, "Error", "Service tag must be 5 or 7 alphanumeric characters and end with 1!") Else If IsChecked($Driver) Then _Fire($serv_tag) If IsChecked($Manual) Then _Fire2($serv_tag) If IsChecked($Warranty) Then _Fire3($serv_tag) ExitLoop EndIf Case $msg = $Exit ExitLoop EndSelect WEnd Exit 0 Func _Fire($sServiceTag) $oIE = _IECreate("http://www.dell.com/support/drivers/us/en/04/DriversHome/NeedProductSelection",0 ,1 ,0) EndFunc Func _Fire2($sServiceTag) $oIE = _IECreate("http://support.dell.com/support/topics/global.aspx/support/my_systems_info/manuals?c=us&l=en&s=biz&~ck=ln&lnki=0&ServiceTag=" & $sServiceTag, 0, 1, 0) EndFunc Func _Fire3($sServiceTag) $oIE = _IECreate("http://support.dell.com/support/topics/global.aspx/support/my_systems_info/details?c=us&cs=555&l=en&s=biz&~ck=anavml&ServiceTag=" & $sServiceTag, 0, 1, 0) EndFunc Func IsChecked($control) Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED EndFunc Any advice would be wonderful.