it does not matter what kind of loop gets inserted to replace for next
using
orWhile counter < files counter+=1 ... Wend
or alsoRepeat counter+=1 ... Until counter>=files
seems no counting loop is started the normal way as we would expect it. It's alike it were parsing the wrong lineDo :counter+=1 ... If counter=files then Exit Do Loop