Dim( file_name, string ) Dim( file_date, date ) Dim( empty, boolean ) Dim( dir_str, string ) Dim( today, date ) Dim( days_old, number ) Dim( too_old, boolean ) Today( today ) Dir( "c:\\temp\\*.*", dir_str ) isEqual( dir_str, "", empty ) LoopUntil( empty, DONE ) GetToken( ",", dir_str, file_name ) Concat( "c:\\temp\\", file_name, file_name ) FileGetDate( file_name, file_date ) DateDiff( file_date, today, days_old ) isGreater( days_old, 10, too_old ) if( too_old, DELETE_IT, NEXT_FILE ) DELETE_IT: FileDelete( file_name ) NEXT_FILE: isEqual( dir_str, empty ) DONE: : I'm trying to delete all files that are older than 10 days. The SysOp told me : to use Dir to get the list of files then use GetToken in a loop LoopUntil : until the returned list is empty. Then for every file use FileDate and : DateDiff. : This is how far i've gotten (below). There are 2 things i don't understand. : First, how do i construct a LoopUntil the GetToken returns empty. When I : look into help for LoopUntil the first parameter is a boolean expression. : Can somebody please tell me how I would write a LoopUntil my dir_str is : empty? THanks. : and second, if it's running the GetToken until the string is empty, isn't it : just going to keep replacing the value of my Dir in the return part of the : LoopUntil function? Like my return_str variable. Won't it just keep : getting overwritten? Doesn't seem very dynamic. : Thanks in advance, : Nico : Dim dir_str, string : Dim s1, string : Dim return_str, string : //Defined my comma seperator for the string to hold the file names : Set( s1, ",") : //Grabbing list of files in the dir : Dir( c:\\temp\*.*, dir_str ) : LoopUntil( empty, done ) : GetToken( s1, dir_str, return_str ) : DONE: //haven't programmed to this point yet :)
|