I am trying to delete all .mem files in a folder where filedate() is less then date() - 20
I do not know the name of the files. I can delete them if I know the name of the file.
mem is a folder in the current path.
Thanks, Jimmy
the first characters of file name are a date. How could i use that instead if file date like.
filename is 0707202211002.mem this is a date, a time, and a column number with no separators.
I will try and let you know. You give me so may new ideas from your programming knowledge.
Tied up for rest of day.
You got me thinking. I have a field in table that is create date of record.
It would be easy to go though file and if field date is less then ? create file name and delete it.
Hi Jimmy
The following seems to work fine.
I just keep looping though the file.
This works better because I am using a field with original date. If using system date it changes with each modification of record.
SET DATE FORMAT TO 'ddmmyyyy'
fi2 := dtoc(date) //+fi1+alltrim(str(tim))
SET DATE FORMAT TO 'dd/mm/yyyy'
fi := 'Appmem\'+fi2+fi1+alltrim(str(tim))+'.mem'
if file(fi)
erase (fi)
endif