icu Posted September 14, 2011 Posted September 14, 2011 (edited) 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 September 15, 2011 by icu
taietel Posted September 14, 2011 Posted September 14, 2011 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 Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text
icu Posted September 15, 2011 Author Posted September 15, 2011 (edited) @taietel: Thank you very much for your help! Your idea works perfectly... I've only changed the EndIf to EndFunc ;-) Func _LoopArray($aArray, $iStart=0, $iEnd="") If $iEnd="" Then $iEnd=UBound($aArray)-1 For $i=$iStart To $iEnd ;Do something Next EndFunc ;==> _LoopArray Edited September 15, 2011 by icu
taietel Posted September 15, 2011 Posted September 15, 2011 Oops... I blame the down arrow. Glad it fits you. Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text
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