Re: [02/03] Progress bar

I use this code to loop through a list of files in an array and count certain files in a certain date range using this code:

VB Code: 'Loops through the list of files in the file list array. 'It will then determine by each file what the last write time or modified date was and compare that value to the dates selected For Each File In arrFiles If todayScan = True Then If Format(IO.File.GetLastWriteTime(File), "MM/dd/yyyy") >= startDate Then shortFilename = Mid$(File, InStrRev(File, "\") + 1) truncatedFilename = Split(shortFilename, "_") picCity = VB.Left(truncatedFilename(0), 2) picNum = truncatedFilename(1) If State(counter) = Nothing Then State(counter) = picCity End If If State(counter) = picCity Then countArray(counter) = countArray(counter) + 1 End If If State(counter) picCity Then counter = counter + 1 State(counter) = picCity countArray(counter) = countArray(counter) + 1 End If 'Re-dimension array objects to the one more then the value of the counter variable ReDim Preserve State(counter + 1) ReDim Preserve countArray(counter + 1) fileCounter = fileCounter + 1 End If Else If Format(IO.File.GetLastWriteTime(File), "MM/dd/yyyy") >= startDate And Format(IO.File.GetLastWriteTime(File), "MM/dd/yyyy")
Posted On: Saturday 3rd of November 2012 12:50:44 PM Total Views:  239
View Complete with Replies