Moughor Posted January 8, 2009 Share Posted January 8, 2009 (edited) Hi all Could you please explain me what mean exactly this error and from where it may come ?Thanks in advance,MoughorArray error Edited January 8, 2009 by Moughor Link to comment Share on other sites More sharing options...
Marlo Posted January 8, 2009 Share Posted January 8, 2009 It means your treating a non array variable as an array. Post your code and maybe we can help you more. Click here for the best AutoIt help possible.Currently Working on: Autoit RAT Link to comment Share on other sites More sharing options...
Moughor Posted January 8, 2009 Author Share Posted January 8, 2009 (edited) It's well working during "some time" afterwards this error occurs. first time it was like 25 minutes and second time 6 hours CODE Func filef() $cptPC = 0 $PC = PixelGetColor( $i , $j ) $HG = PixelGetColor( $i-1 , $j-1 ) $HC = PixelGetColor( $i , $j-1 ) $HD = PixelGetColor( $i+1 , $j-1 ) $BG = PixelGetColor( $i-1 , $j+1 ) $BD = PixelGetColor( $i+1 , $j+1 ) $BC = PixelGetColor( $i , $j+1 ) If( ($PC = $HG) or ($PC = $HC) or ($PC = $HD) )Then if ( $PC = $HG) then $cptPC = $cptPC + 1 if ( $PC = $HC) then $cptPC = $cptPC + 1 if ( $PC = $HD) then $cptPC = $cptPC + 1 if ( $cptPC = 1 ) Then If ( ($PC = $BG) or ($PC = $BC) or ($PC =$BD)) Then if ( $PC = $BG) then $cptPC = $cptPC + 1 if ( $PC = $BC) then $cptPC = $cptPC + 1 if ( $PC = $BD) then $cptPC = $cptPC + 1 if ( $cptPC = 2 ) Then $EGG = PixelGetColor( $i-2 , $j-2 ) $EG = PixelGetColor( $i-1 , $j-2 ) $EC = PixelGetColor( $i , $j-2 ) $ED = PixelGetColor( $i+1 , $j-2 ) $EDD = PixelGetColor( $i+2 , $j-2 ) if ( ($PC = $EGG) or ($PC = $EG) or ($PC = $EC ) or ($PC = $ED) or ($PC = $EDD ) )Then if ( $PC = $EGG) then $cptPC = $cptPC + 1 if ( $PC = $EG) then $cptPC = $cptPC + 1 if ( $PC = $EC) then $cptPC = $cptPC + 1 if ( $PC = $ED) then $cptPC = $cptPC + 1 if ( $PC = $EDD) then $cptPC = $cptPC + 1 if ( $cptPC = 3 ) Then $DGG = PixelGetColor( $i-2 , $j+2 ) $DG = PixelGetColor( $i-1 , $j+2 ) $DC = PixelGetColor( $i , $j+2 ) $DD = PixelGetColor( $i+1 , $j+2 ) $DDD = PixelGetColor( $i+2 , $j+2 ) if ( ($PC = $DGG) or ($PC = $DG) or ($PC = $DC ) or ($PC = $DD) or ($PC = $DDD ) )Then if ( $PC = $DGG) then $cptPC = $cptPC + 1 if ( $PC = $DG) then $cptPC = $cptPC + 1 if ( $PC = $DC) then $cptPC = $cptPC + 1 if ( $PC = $DD) then $cptPC = $cptPC + 1 if ( $PC = $DDD) then $cptPC = $cptPC + 1 if ( $cptPC = 4 ) Then $lmm = PixelSearch( $i-2, $j-2,$i+2 , $j-2, $PC ) $lm = PixelSearch( $i-1, $j-1,$i+1, $j-1, $PC ) $lp = PixelSearch( $i-1, $j+1,$i+1 , $j+1, $PC ) $lpp = PixelSearch( $i-2, $j+2,$i+2 , $j+2, $PC ) $D1 = Abs( $lmm[0] - $lm[0]) $D2 = Abs( $lpp[0] - $lp[0]) IF($D1 < 2 ) Then If($D2 < 2 ) Then ;~ return 1 EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf return 0 EndFunc Edited January 8, 2009 by Moughor Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 8, 2009 Share Posted January 8, 2009 It's well working during "some time" afterwards this error occurs. first time it was like 25 minutes and second time 6 hoursPlease use codebox vice code tags for long stuff like that.Where does the error occur? No, I'm not going to download anything from imageshack... Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Moughor Posted January 8, 2009 Author Share Posted January 8, 2009 (edited) Please find the error i had Autoit Error line -1: Error : Subscript used with non-Array variable. ps : thx for the tip Edited January 8, 2009 by Moughor Link to comment Share on other sites More sharing options...
Developers Jos Posted January 8, 2009 Developers Share Posted January 8, 2009 Wild guess, but this code should have a check to ensure the returned infomation is an Array: $lmm = PixelSearch($i - 2, $j - 2, $i + 2, $j - 2, $PC) $lm = PixelSearch($i - 1, $j - 1, $i + 1, $j - 1, $PC) $lp = PixelSearch($i - 1, $j + 1, $i + 1, $j + 1, $PC) $lpp = PixelSearch($i - 2, $j + 2, $i + 2, $j + 2, $PC) $D1 = Abs($lmm[0] - $lm[0]) $D2 = Abs($lpp[0] - $lp[0]) Because i don't think an array is returned by pixelsearch() when the color isn't found. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Moughor Posted January 8, 2009 Author Share Posted January 8, 2009 thx for reply , i will try this and let you know M. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now