FOR QWER = 1 TO TEM *!* if all you are doing is stripping the extension of the filename: AQUI = JUSTSTEM(ARQUIVOSTXT[QWER,1]) NOMEDAVAR = "VELHO_" + AQUI *!* the next line could never be FALSE because of the line above IF NOMEDAVAR <> AQUI ARQUIVO = AQUI + ".TXT" =deletemp(arquivo) =STRTOFILE(AQUI,ARQUIVO) THISFORM.LOGLOG([Edição de listas TXT - alterado arq.: ] + arquivo) ENDIF NEXT