xbushido

Any way to shorten this?

3 posts in this topic

#1 ·  Posted

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted

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.


I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

#3 ·  Posted

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)

 

1 person likes this

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