Archive: How Do You Make The Same Loop, Loop X Amount of Times?


How Do You Make The Same Loop, Loop X Amount of Times?
I've across the need for a loop in which will loop something very simple (checking for file existence). BUT, if the file never comes into existence I need to escape the infinite horror.

How do you loop the same exact loop yet only do it an x amount of times?

Thanks for any help on this!


!define LoopCount 100
Push $R0
StrCpy $R0 0
Loop:

# do stuff here

IntOp $R0 $R0 + 1
StrCmp $R0 ${LoopCount} 0 Loop
Pop $R0
!undef LoopCount


-Stu

Thank you Afrow, it is very appreciated. your solution is exactly what it was I needed and it definitely looks better than what I was working on ;)

Thanks again!


And with LogicLib:

${For} $R1 1 100
# something...
${Next}