Simon,
You bring up a good point here that's very subtle. When the DIR function can find the file you requested, the fully qualifed filename will be retured. If it can't find the file an empty string is returned.
The subtle point of this is how you test to see if the Dir function was successful. Typically most books and code that I've seen on the net would do something like this:
If sTemp <> "" Then
In your example you chose to look at the length of the string. This is actually an optimization technique that the NuMega software informs you about during a code review. Checking the Length of the string is actually faster than checking for an empty string and it's a good habit to get into.
Since I saw it here I wanted to make a point of if for the others that might not know about this optimization technique.
I do have a question for you though... If the Dir function returns a String data type and Strings can't be NULL, why did you decide to include the & "" after the variable sTemp in the comparison statement? Snaggs
tribesaddict@swbell.net