Jump to content

How do I start a loop through an array at different points? [solved]


icu
 Share

Recommended Posts

Dear AutoIt Community,

I'm not having any luck figuring out a way that will let me start a loop through an array at different points in the array.

Say I have an array called $av_Array and at this particular time I need the loop to start at $av_Array[159] and continue until it gets to UBound($av_Array). Next time I run the program I might need it to start at $av_Array[5689] and continue until it gets to UBound($av_Array)... how would I go about this?

Compounding my problem is that I have 3 sets of nested loops, the top two of which I'll need to set the loop entry point for.

Any and all help is greatly appreciated.

Kind regards,

icu

Edited by icu
Link to comment
Share on other sites

I don't know if it helps, but you can try:

Func _LoopArray($aArray, $iStart=0, $iEnd="")
If $iEnd="" Then $iEnd=UBound($aArray)-1
For $i=$iStart To $iEnd
;Do something
Next
EndIf
Link to comment
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
 Share

×
×
  • Create New...