frontmill Posted February 5, 2007 Posted February 5, 2007 hey guys, i've got a (probably kind of stupid) question about how to define a 2 dimensinal array. This is the function i need it for, i used dim, but that doesnt seem to work. please help me . Thanks in advance! func _scanareacolor($i_xleft,$i_yupper,$i_xright,$i_yunder,$i_color) $xpointer = $i_xleft $ypointer = $i_yupper $ystop = $i_yunder + 1 dim $check While $ypointer <> $ystop $color = PixelGetColor($xpointer,$ypointer) if $color = "000000" Then $check[$ypointer][$xpointer] = 1 Else $check[$ypointer][$xpointer] = 1 EndIf If $xpointer = $i_xright Then $ypointer = $ypointer + 1 $xpointer = $i_xleft Else $xpointer = $xpointer + 1 EndIf WEnd Return $check EndFunc
flyingboz Posted February 5, 2007 Posted February 5, 2007 look in the help under dim Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.
frontmill Posted February 5, 2007 Author Posted February 5, 2007 yeah i already read that, but i still don't get it. The help file only speaks of a way to give a value to variable right away, like this: Dim $Grid[4][4]=[["Paul", "Jim", "Richard", "Louis"], [485.44, 160.68, 275.16, 320.00]] but it doesnt say anything about what im trying to do.
improbability_paradox Posted February 5, 2007 Posted February 5, 2007 dim $check[a number here][another number here] for example, dim $check[2][2] would create an array that can store data at $check[0][0] $check[0][1] $check[1][0] $check[1][1] make sense?
Moderators SmOke_N Posted February 5, 2007 Moderators Posted February 5, 2007 I don't understand what you are trying to do with your setup. But by the Function name, I am going to assume you are trying to get all the specific colors found in a region. If that is the case, try this. http://www.autoitscript.com/forum/index.ph...st&p=266683 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
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