What is the limit of the 'for' function?

Take a look in this code:

I think that with some adjusts it can easily do what you are looking for.