@tera
Good point! ;-)
The code shown here is only an abstraction of my real code. I’m currently checking to see if I did the same mistake in my real code…
version 3 from tera should be the version 1 from you equivalent to version 2 from you. Your indexing is wrong in the first code snippet. Please try your test again after correcting is done.
Are the variables rows and cols static, defines or may they change during execution (multiple calls of that loop)?