Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading Directory Files

Status
Not open for further replies.

Bensta

Programmer
Jul 21, 2003
122
US
I hope that someone will be kind enough to help me solve this problem I am having. I am trying to create a program that is continuously running that monitors the directory and by default displays the file with the biggest file number - the youngest file in the set. Because every new .evt file name is the next number in the sequence, the most current file is the one with the highest numerical value for its name. The files look something like this 8765.evt.
Rather than any selection process, we simply want to cursor through the file set. In other words; by default (after two minutes of inactivity) the display will always show the youngest file. If the user wants to see something made earlier that day, the user will press the cursor up key – or an arrow on the screen, and the file with the previous number will be displayed; MaxFileNumber minus 1. Another Up arrow, and the user sees MaxFileNumber minus 2 and so on. If you want to see the load they made at noon, and they’ve made three since then, you cursor up three times.
I also want to back up a whole day, we just need to know the number of the first file for that date, then display it. Maybe a CTRL cursor up does that. The relationship between any day and the lowest numbered file for that day never changes. We can have the program re-read the directory when it loads, or store that info in an external data table that the program can read.
Any help will be greatly appreciated.

Thank you

Bensta


 
The DIR Command will find a file in a directory, repeating it will find the next file..
Matching these results against string arguments will allow you to find specific files.

For a more advanced look into the file system
Search this forum for "FSO" or "FileSystemObject"

HTH

Jag

yosherrs.gif

[tt]'Very funny, Scotty... Now Beam down my clothes.'[/tt]
 
Thank you Jag for your answer to my question.
Do you have an example of dir command that keeps reading next files in the list, and also find the lowest file number.
Thank you
Bensta
 
Try F1 - there is a worked example in VBHelp. Also read faq222-2244 to see how to get the best from these forums

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top