anyday Posted March 23, 2006 Share Posted March 23, 2006 In the following code im needing to know if it is possible, when the script gets the the $title = WinGetTitle( "", "" ) If $title = "The page cannot be displayed - Microsoft Internet Explorer" Then _IENavigate($oIE, "website" ) Else if this statement is true is there anyway i can make it goto the next case statement in my script? expandcollapse popupCase $msg = $policyinfosub BlockInput (1) $oIE = _IECreate() WinSetState("about:blank - Microsoft Internet Explorer", "", @SW_MAXIMIZE) _IENavigate($oIE, "https://website", 0) _IELoadWait($oIE) $title = WinGetTitle( "", "" ) If $title = "The page cannot be displayed - Microsoft Internet Explorer" Then _IENavigate($oIE, "website" ) Else WinWaitActive ( "Connect to infocenter", "&User name" ) ControlSend ( "Connect to infocenter", "&User name", "Edit2", $FFLOGIN1 ) ControlSend ( "Connect to infocenter", "&User name", "Edit3", $FFPASS1 ) ControlClick ( "Connect to infocenter", "&User name", "Button2" ) WinWaitActive ("Infocenter - Microsoft", "Links") _IENavigate($oIE, "website") WinSetState(" website", "", @SW_MAXIMIZE) WinActivate (" website", "" ) $o_form = _IEFormGetObjByName($oIE, "LOGINFORM") $o_login = _IEFormElementGetObjByName($o_form, "userName") $o_password = _IEFormElementGetObjByName($o_form, "password") _IEFormElementSetValue($o_login, $FFLOGIN1 ) _IEFormElementSetValue($o_password, $FFPASS1) Send ("{Tab 2}") Send ("{Enter}") _IELoadWait($oIE) BlockInput (0) $n = 14 $s = 23 Send ("{Tab "& $n & "}") Send ("{Enter}") Sleep ( 3000 ) MouseClick ( "left", 443,268, 1 ) Sleep ( 100 ) Send(GUICtrlRead ($PolicyNumber)) Sleep ( 100 ) MouseClick ( "left", 494, 579, 1) BlockInput (0) EndIf Case $msg = $cert MsgBox (4096, "D", $FFLOGIN1, 10 ) Link to comment Share on other sites More sharing options...
greenmachine Posted March 23, 2006 Share Posted March 23, 2006 Make the inside of the Case statement a function, and then just call the function whenever you need. Link to comment Share on other sites More sharing options...
MHz Posted March 23, 2006 Share Posted March 23, 2006 In the following code im needing to know if it is possible, when the script gets the the $title = WinGetTitle( "", "" ) If $title = "The page cannot be displayed - Microsoft Internet Explorer" Then _IENavigate($oIE, "website" ) Else if this statement is true is there anyway i can make it goto the next case statement in my script?The keyword is ContinueCase. Use it in your If block. 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