Continue a loop until a certain number is reached

(topic deleted by author)