Sign in to follow this  
Followers 0
Hoth2001

loop values from array

2 posts in this topic

Much of the examples I research seem to show how to loop through an array all at one time.

I'm trying to loop through elements in an array and call their values at different points in my code.  And I'm stuck......

Here's the code I started out with:

; INTEND TO SEND INFO FROM ARRAY [1][0]
MouseClick('primary', 585,210, 1, 0)
Sleep(300)
Send( )
Sleep(300)

;INTEND TO SEND INFO FROM ARRAY [1][1]
MouseClick('primary', 585,210, 1, 0)
Sleep(300)
Send( )
Sleep(300)

; INTEND TO SEND INFO FROM ARRAY [2][0]
MouseClick('primary', 585,210, 1, 0)
Sleep(300)
Send( )
Sleep(300)

;INTEND TO  SEND INFO FROM ARRAY [2][1]
MouseClick('primary', 585,210, 1, 0)
Sleep(300)
Send( )
Sleep(300)

and so on...and so forth.....to the end of the array

Using a for $element In $aArray  still doesn't seem to enable me to call the values when I need them at different lines in the code.

 

Help needed!! Thanks!!

 

 

 

Share this post


Link to post
Share on other sites



Looks like you need to use nested loops. Try the following:

 

For $i = 1 To UBound($array) - 1
    For $j = 0 To UBound($array, 2) - 1
        MouseClick('primary', 585, 210, 1, 0)
        Sleep(300)
        Send($array[$i][$j])
        Sleep(300)
    Next
Next

 

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