nFiles = ADIR(aBWFiles,SOURCEPATHNAME + SOURCEFILEMASK)
>LOCAL cConCatString, aBWFile[1,5], nFiles, iThis is the first possible problem; I refer to an array aBWFiles everywhere other than the local; changing "aBWFile" to "aBWFiles" might correct this.
#DEFINE SOURCEPATHNAME = '.\BW\' && this is the BW subfolder of the Current Working DirectoryYou might want to try changing this into an absolute path rather than a relative path - the BW subfolder might not reside beneath your current working folder
#DEFINE SOURCEFILEMASK = 'PROCESS*.DAT' >>cConCatString = '' >>nFiles = ADIR(aBWFiles,SOURCEPATHNAME + SOURCEFILEMASK) >>FOR i = 1 TO nFiles && this avoids all copies if no files were found >> cConCatString = cConCatString + FILETOSTR(SOURCEPATHNAME + aBWFiles[i,1]) >>ENDFOR >>=STRTOFILE(cConCatString,'MyConCatFile.DAT',.F.) && .T. would append to any existing MyConCatFile.DAT found >>RELEASE cConCatString && releases the large string memory allocation