Jump to content

"Undeclared global variable"


bald1
 Share

Recommended Posts

\Fix18-10-09.au3(74,56) : WARNING: $coordbox2: possibly used before declaration.

$closeCoord1 = PixelSearch($coordbox1, $coordbox2,

Fix18-10-09.au3(74,56) : ERROR: $coordbox2: undeclared global variable.

$closeCoord1 = PixelSearch($coordbox1, $coordbox2,

I get this error all of a sudden, and i dont even remember changing anything in the script. The variables, all of them, are declared in beginning of the script. Tried making them both local and global with no change. I havent used this bit in a while, and the error didnt show itself before last night for some strange reason. What could i have changed in this script to generate this, through my noob-perspektive, unjustified error? :)

Link to comment
Share on other sites

Could you please post your code so we can have a look at it? Makes debugging a lot easier :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Could you please post your code so we can have a look at it? Makes debugging a lot easier :)

while $continue = True
                $Coords1 = PixelSearch($vFullSearchCoords1, $vFullSearchCoords2, $vFullSearchCoords3, $vFullSearchCoords4, $aFullSearch[$i], 5, 1); search for den store pixel
                If Not @error Then

                    
                    
                    
                    $coordbox1 = $coords1[0] - 50; Create coord box
                    $cooodbox2 = $coords1[1] - 50
                    $coordbox3 = $coords1[0] + 75
                    $coordbox4 = $coords1[1] + 100
                    
                    

                    For $z = 0 to 1 step + 1
                        $closeCoord1 = PixelSearch($coordbox1, $coordbox2, $coordbox3, $coordbox4, $aCloseUpSearch[$i][$z], 8, 1); box search pixels
                        If not @error Then
                            $var = $var + 1
                        Else
                            $var = 0
                        EndIf
                    Next
                    If $var = 2 Then

and tons more that should irrelevant :)

All the variables are declared in the local scope earlier..

Edited by bald1
Link to comment
Share on other sites

while $continue = True
                $Coords1 = PixelSearch($vFullSearchCoords1, $vFullSearchCoords2, $vFullSearchCoords3, $vFullSearchCoords4, $aFullSearch[$i], 5, 1); search for den store pixel
                If Not @error Then

                    sleep(100)
                    
                    Sleep(1000)
                    $coordbox1 = $coords1[0] - 50; Create coord box
                    $cooodbox2 = $coords1[1] - 50
                    $coordbox3 = $coords1[0] + 75
                    $coordbox4 = $coords1[1] + 100
                    
                    Sleep(100)

                    For $z = 0 to 1 step + 1
                        $closeCoord1 = PixelSearch($coordbox1, $coordbox2, $coordbox3, $coordbox4, $aCloseUpSearch[$i][$z], 8, 1); box search pixels
                        If not @error Then
                            $var = $var + 1
                        Else
                            $var = 0
                        EndIf
                    Next
                    If $var = 2 Then

and tons more that should irrelevant :)

All the variables are declared in the local scope earlier..

lol, could be because you spelt it "$cooodbox2 = $coords1[1] - 50" Edited by furrycow
Instant Lockerz Invite - www.instantlockerzinvite.co.uk
Link to comment
Share on other sites

lol, could be because you spelt it "$cooodbox2 = $coords1[1] - 50"

wtfh o0

I used this plenty of times without it erroring out and it working perfectly and now this all of a sudden hahah. Thanks, and sorry for the bother :)

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...