Skip to content
⌘ NSIS Forum Archive

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

4 posts

vbgunz#

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!
Afrow UK#
!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
vbgunz#
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!