User must select from list of files sorted by DateLastModified
Posted on 2003-03-24
I need some help with file manipulation in VB6.
(Note: I would like to accomplish this task without using FileListBox)
Directory c:\StoreFiles contains from 0 to 10 (varies) files all with different primary filenames but sharing a common file extension ".01". These are comma-delineated sequential text files.
File names must be presented to user in something like a ListBox sorted by DateLastModified from oldest to newest, with the oldest already highlighted. User must select the oldest, and when this event occurs I'd llke to present a view if the file (multiline TextBox or whatever) so that user can see contents in its native ASCII format. After user acknowledges in a MsgBOX he/she wishes to continue processing the file, I'll input the file into fields of a database table (I've been able to read any of these files into DB successfully when I give the Input statement a unique filename). The file that was selected and processed must then be moved to directory c:\OldFiles, and must be removed from the ListBox. Now the ListBox contains one less file, but is still sorted with oldest first and highlighted. This process repeats until all the files have been processed.
I've examined several previous posts about API and sorting, but haven't been able to easily:
1) Read C:\StoreFiles for all filenames with .01 extension, then
2) Present the files to user for selection sorted with oldest file first and highlighted, then
3)Move the file after processing to c:\OldFiles and remove it from the ListBox (or whatever control is best for presenting, selecting).
Again, I would like to avoid a hiden or visible FileListBox, which I undestand to be an aged or old tool. Thanks in advance.