Is there a way to debug code in Setup? Trying to use a for

I corrected in original post.

Naughty !
Now posts that refer to the original don't make sense.