Sign in to follow this  
Followers 0
anyday

Case Help

3 posts in this topic

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?

Case $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 )

Share this post


Link to post
Share on other sites



Make the inside of the Case statement a function, and then just call the function whenever you need.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0