>lcstring=FILETOSTR(filename) >if OCCURS(CHR(13)+CHR(10),lcstring)>5000 > =strtofile(substr(lcstring, at(CHR(13)+CHR(10),lcstring,1000)+2,filename) >endif >You beat me to this one... but then, it's not perfect - we are relying on the EOL marker being CRLF, but the file could have been edited with something that leaves only a CR (OK, nitpicking, I know). So just to show that the usual number of ways to do something in Fox is not always three, it can be much more:
lcString=filetorstr(filename) set memowith to 200 && or as needed n=memlines(lcString) if n>5000 cl1001=mline(lcString,1001) && the first line to keep strtofile("Truncated at "+transform(datetime())+; substr(lcString, at(cl1001, lcString)+len(cl1001)), filename) endif