in reply to Re^2: Out of memory
in thread Out of memory

No like already said you have to replace the for-loop

Look this is no " copy and pasted code fixing service" , you need to to try to understand what your code does.

Cheers Rolf

PS: Je suis Charlie!