I need to run a loop a number of times defined by the user. But the user will have as well the possibility to run the loop infinitely. I thought of using a While loop with some logic between its counter of loop iteration and the loop condition. I was wondering if there is any other easier possibility (perhaps with the for loop).
Thanks for your help.
Solved! Go to Solution.
FOR loops are lazy. They can only run for so long. Your best bet would to to use the iteration terminal and do the comparison.
Yes, WHILE loop all the way.
"Infinitely" is a very long time!
Note that the iteration terminal is I32 and will saturate at one point (stuck at 2147483647). If you need it to continue, you might want do make your own, incrementing a 64bit integer in a shift register, for example. Make sure you don't autoindex at any output tunnels, or you'll run out of memory.