Sign in to follow this  
Followers 0
bald1

"Undeclared global variable"

6 posts in this topic

\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? :)

Share this post


Link to post
Share on other sites



Sorry about this repost, i don't seem to be able to delete my own posts..

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
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 :)

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