xbushido Posted May 7, 2017 Posted May 7, 2017 Dim $dragA1[2] = "1114, 220" $dragAc = 0xFFFFFF Dim $dragAA1[2]= "1176, 275" $dragAAc = 0xFFFFFF Dim $dragB1[2]="566, 194" $dragBc = 0xFFFFFF Dim $dragA2[2] = "$dragA1[0]+1, $dragA1[1]+1" Dim $dragAA2[2] = "$dragAA1[0]+1, $dragAA1[1]+1" Dim $dragB2[2] = "$dragB1[0]+1, $dragB1[1]+1" Is there any way I can shorten this or clean it up (ie. too many Dims)? I tried placing as code but the colors were all off.
Xandy Posted May 7, 2017 Posted May 7, 2017 Code colors get fixed after finalized post :). Basically just ignor the first appearance of the code colors and it will turn out fine. I don't know the goal of the code maybe you could use a 2 dimensional array? Doesn't really matter. Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker)
Subz Posted May 8, 2017 Posted May 8, 2017 As Xandy mentioned you could use 2D Array for example: #include <Array.au3> ;~ Only required for _ArrayDisplay Global $aDrag[3][3] = [[1114, 220, "0xFFFFFF"], [1176, 275, "0xFFFFFF"], [566, 194, "0xFFFFFF"]] For $i = 0 To UBound($aDrag) - 1 MsgBox(48, "Array Info", "Drag" & $i & " : " & $aDrag[$i][0] + 1 & " - " & $aDrag[$i][1] + 1) Next _ArrayDisplay($aDrag) Xandy 1
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