Jump to content

array variable has incorrect number of subscripts dimension range exceeded


bbk4163
 Share

Recommended Posts

Hi, 
I am getting "array variable has incorrect number of subscripts dimension range exceeded" error while executing exe. Not sure what is wrong here. 

#include <MsgBoxConstants.au3>


SelectWindowBasedOnTitle()

Func SelectWindowBasedOnTitle()

    $winList = WinList()
    $wTitle = CheckWindows($winList)

   IF $wTitle == "Choose File to Upload" Then
            IE()
   ElseIf $wTitle == "Open" Then
            Chrome()
   Else
            FireFox()
   EndIf
EndFunc


Func CheckWindows($aArray)

    For $i = 1 To Ubound($aArray) - 1
        If WinActive($aArray[$i][1]) Then $wTitle= $aArray[$i][0] ;MsgBox(0, "Window Check", $aArray[$i][0] & " is active.")
    Next
    Return $wTitle
EndFunc


Func Example()
    $wText = WinGetText("[ACTIVE]")
EndFunc

Func IE()
    ControlFocus("Choose File to Upload","","Edit1")
    ControlSetText("Choose File to Upload","","Edit1",$CmdLine[1])
    ControlClick("Choose File to Upload","","Button1")
EndFunc

Func Chrome()
    ControlFocus("Open","","Edit1")
    ControlSetText("Open","","Edit1",$CmdLine[1])
    ControlClick("Open","","Button1")
EndFunc

Func FireFox()
    ControlFocus("File Upload","","Edit1")
    ControlSetText("File Upload","","Edit1",$CmdLine[1])
    ControlClick("File Upload","","Button1")
EndFunc

 

Link to comment
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
 Share

×
×
  • Create New...