Jump to content

Error Message when running script


Recommended Posts

Running this script off of one of our servers, and after it has processed what it needs to (reassignment) of 15 - 60 accounts this error opens.  Resulting in the end of the script and having to pick up where it left off.  Does anyone have an idea of what would cause this?

errorautoit.JPG

Link to post
Share on other sites

I apologize, here is the block of code:

 

  Switch $sMode
        Case "byValue"
            For $oItem In $oItems
                If $oItem.value = $sString Then
                    Switch $iSelect
                        Case -1
                            Return SetError($_IESTATUS_Success, 0, $oItem.selected)
                        Case 0
                            If Not $bIsMultiple Then
                                __IEConsoleWriteError("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", _
                                        "$iSelect=0 only valid for type=select multiple")
                                Return SetError($_IESTATUS_InvalidValue, 3)
                            EndIf
                            If $oItem.selected Then
                                $oItem.selected = False
                                If $iFireEvent Then
                                    $oObject.fireEvent("onChange")
                                    $oObject.fireEvent("OnClick")
                                EndIf
                            EndIf
                            Return SetError($_IESTATUS_Success, 0, 1)
                        Case 1
                            If Not $oItem.selected Then
                                $oItem.selected = True
                                If $iFireEvent Then
                                    $oObject.fireEvent("onChange")
                                    $oObject.fireEvent("OnClick")   <-------- Error Occurs on this particular line of code
                                EndIf
                            EndIf
                            Return SetError($_IESTATUS_Success, 0, 1)

Link to post
Share on other sites

When posting use <> on toolbar (before emoticon). 

When I said posting a runable snippet.  I meant something that we can actually run to see the error.  It is very hard for us to guess what could be the error even with the code you just provided...

Link to post
Share on other sites

I hope this is a little closer to what you were looking for.  This is the entire block of code where the particular error is taking place.

Func _IEFormElementOptionSelect(ByRef $oObject, $sString, $iSelect = 1, $sMode = "byValue", $iFireEvent = 1)
    If Not IsObj($oObject) Then
        __IEConsoleWriteError("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidDataType")
        Return SetError($_IESTATUS_InvalidDataType, 1, 0)
    EndIf
    ;
    If Not __IEIsObjType($oObject, "formselectelement") Then
        __IEConsoleWriteError("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidObjectType")
        Return SetError($_IESTATUS_InvalidObjectType, 1, 0)
    EndIf
    ;
    Local $oItem, $oItems = $oObject.options, $iNumItems = $oObject.options.length, $bIsMultiple = $oObject.multiple

    Switch $sMode
        Case "byValue"
            For $oItem In $oItems
                If $oItem.value = $sString Then
                    Switch $iSelect
                        Case -1
                            Return SetError($_IESTATUS_Success, 0, $oItem.selected)
                        Case 0
                            If Not $bIsMultiple Then
                                __IEConsoleWriteError("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", _
                                        "$iSelect=0 only valid for type=select multiple")
                                Return SetError($_IESTATUS_InvalidValue, 3)
                            EndIf
                            If $oItem.selected Then
                                $oItem.selected = False
                                If $iFireEvent Then
                                    $oObject.fireEvent("onChange")
                                    $oObject.fireEvent("OnClick")
                                EndIf
                            EndIf
                            Return SetError($_IESTATUS_Success, 0, 1)
                        Case 1
                            If Not $oItem.selected Then
                                $oItem.selected = True
                                If $iFireEvent Then
                                    $oObject.fireEvent("onChange")
                                    $oObject.fireEvent("OnClick")
                                EndIf
                            EndIf
                            Return SetError($_IESTATUS_Success, 0, 1)
                        Case Else
                            __IEConsoleWriteError("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", "Invalid $iSelect value")
                            Return SetError($_IESTATUS_InvalidValue, 3, 0)
                    EndSwitch
                EndIf
            Next
            __IEConsoleWriteError("Warning", "_IEFormElementOptionSelect", "$_IESTATUS_NoMatch", "Value not matched")
            Return SetError($_IESTATUS_NoMatch, 2, 0)
        Case "byText"
            For $oItem In $oItems
                If String($oItem.text) = $sString Then
                    Switch $iSelect
                        Case -1
                            Return SetError($_IESTATUS_Success, 0, $oItem.selected)
                        Case 0
                            If Not $bIsMultiple Then
                                __IEConsoleWriteError("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", _
                                        "$iSelect=0 only valid for type=select multiple")
                                Return SetError($_IESTATUS_InvalidValue, 3)
                            EndIf
                            If $oItem.selected Then
                                $oItem.selected = False
                                If $iFireEvent Then
                                    $oObject.fireEvent("onChange")
                                    $oObject.fireEvent("OnClick")
                                EndIf
                            EndIf
                            Return SetError($_IESTATUS_Success, 0, 1)
                        Case 1
                            If Not $oItem.selected Then
                                $oItem.selected = True
                                If $iFireEvent Then
                                    $oObject.fireEvent("onChange")
                                    $oObject.fireEvent("OnClick")
                                EndIf
                            EndIf
                            Return SetError($_IESTATUS_Success, 0, 1)
                        Case Else
                            __IEConsoleWriteError("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", "Invalid $iSelect value")
                            Return SetError($_IESTATUS_InvalidValue, 3, 0)
                    EndSwitch
                EndIf
            Next
            __IEConsoleWriteError("Warning", "_IEFormElementOptionSelect", "$_IESTATUS_NoMatch", "Text not matched")
            Return SetError($_IESTATUS_NoMatch, 2, 0)
        Case "byIndex"
            Local $iIndex = Number($sString)
            If $iIndex < 0 Or $iIndex >= $iNumItems Then
                __IEConsoleWriteError("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", "Invalid index value, " & $iIndex)
                Return SetError($_IESTATUS_InvalidValue, 2, 0)
            EndIf
            $oItem = $oItems.item($iIndex)
            Switch $iSelect
                Case -1
                    Return SetError($_IESTATUS_Success, 0, $oItems.item($iIndex).selected)
                Case 0
                    If Not $bIsMultiple Then
                        __IEConsoleWriteError("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", _
                                "$iSelect=0 only valid for type=select multiple")
                        Return SetError($_IESTATUS_InvalidValue, 3)
                    EndIf
                    If $oItem.selected Then
                        $oItems.item($iIndex).selected = False
                        If $iFireEvent Then
                            $oObject.fireEvent("onChange")
                            $oObject.fireEvent("OnClick")
                        EndIf
                    EndIf
                    Return SetError($_IESTATUS_Success, 0, 1)
                Case 1
                    If Not $oItem.selected Then
                        $oItems.item($iIndex).selected = True
                        If $iFireEvent Then
                            $oObject.fireEvent("onChange")
                            $oObject.fireEvent("OnClick")
                        EndIf
                    EndIf
                    Return SetError($_IESTATUS_Success, 0, 1)
                Case Else
                    __IEConsoleWriteError("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", "Invalid $iSelect value")
                    Return SetError($_IESTATUS_InvalidValue, 3, 0)
            EndSwitch
        Case Else
            __IEConsoleWriteError("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", "Invalid Mode")
            Return SetError($_IESTATUS_InvalidValue, 4, 0)
    EndSwitch
EndFunc   ;==>_IEFormElementOptionSel
Link to post
Share on other sites

Well this is the code coming from the IE.au3 UDF.  Maybe you modified it, I don't know.  That doesn't help either...You need to provide the code that I can copy/paste in Scite, then I can press F5, and the error pops up !

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...