Hi, I seem to be having a problem with the DIR function. I have written code similar to below:
The {Do Stuff} part calls separate functions which write output to files and collectes various file properties using the FileSystemObject.
As you may notice, the first pass will not do anything with the first file, this is so that the first pass writes headers to the output file. The second pass writes info for the first file correctly.
The third pass on the do...loop should then pick up the second file when the DIR command is issued again, however this doesn't seem to be working and I'm getting an empty string returned (i.e. "") and therefore the do...loop is dropping out.
Has anyone come across this, and anyone got any suggestions on how to get round it?
Many thanks for your help in advance,
Fitz
Did you know, there are 10 types of people in this world:
* Those who understand binary
and
* Those who Don't!!
Code:
strFile = DIR("C:\*.csv",vbnormal)
intCounter = 0
Do while strfile <> ""
{Do Stuff including call other functions}
If intCounter = 0 Then
Else
strFile = Dir
End If
intCounter = intCounter + 1
Loop
The {Do Stuff} part calls separate functions which write output to files and collectes various file properties using the FileSystemObject.
As you may notice, the first pass will not do anything with the first file, this is so that the first pass writes headers to the output file. The second pass writes info for the first file correctly.
The third pass on the do...loop should then pick up the second file when the DIR command is issued again, however this doesn't seem to be working and I'm getting an empty string returned (i.e. "") and therefore the do...loop is dropping out.
Has anyone come across this, and anyone got any suggestions on how to get round it?
Many thanks for your help in advance,
Fitz
Did you know, there are 10 types of people in this world:
* Those who understand binary
and
* Those who Don't!!