My script is reading a text filelist (~2000 files) looking for duplicate names (excluding the extension ex; abc.JPG = abc.BMP). If I find a match, I rename the 2nd occurance to filename.ext.ext (abc.BMP.BMP).
On the 21st loop when I hit this line I get the violation.
StringReplace>strPrevFileName,strPrevExtension,.zzz,strPreviousZZZ
(On the previous file name, replace the extension with .zzz)
This happens in debug mode and in Run.
There is nothing unusual about this filename that is different than the previous 20. I tried removing it, and still crash.
Any suggestions how can I debug this further and see what is happening?
Windows7 (x64), MS 12.0.8
Here is entire subroutine
Code: Select all
SRT>CreateFileList
Let>RP_WAIT=1
// Create a filelist of all files under directory contained in image_path
RunProgram>cmd /c dir %IMAGE_PATH% /s /b > %tempFile%
Let>iCntr=1
Let>strPreviousFile=blank.zzz
// Write FILE_LIST
ReadLn>tempFile,iCntr,strCurrentFile
While>strCurrentFile<EOF>strCurrentFile,strCurrentExtension
Length>strCurrentExtension,iCurrentExtension
If>iCurrentExtension>1
// Set previous and current file to .zzz extension and compare names
StringReplace>strCurrentFile,strCurrentExtension,.zzz,strCurrentZZZ
ExtractFileExt>strPreviousFile,strExtPrevious
StringReplace>strPreviousFile,strExtPrevious,.zzz,strPreviousZZZ
If>strCurrentZZZ=strPreviousZZZ
// Rename current by adding the ext on the end again
Let>strCurrentFile=%strCurrentFile%%strCurrentExtension%
EndIf
WriteLn>FILE_LIST,wrtResult,%iCntr%:%strCurrentFile%
EndIf
Let>iCntr=iCntr+1
Let>strPreviousFile=strCurrentFile
ReadLn>tempFile,iCntr,strCurrentFile
EndWhile
END>CreateFileList