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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Len(Dir(windir \ stfile, lngType))

Status
Not open for further replies.

ytakbob

Programmer
Jul 20, 2000
105
US
Len(Dir(windir \ stfile, lngType))
using the above command in a function to pass back as
to whether a certain file exists.
windir = "C:\WINNT" and stfile = "pls120"
lngType = vbnormal
yet I am getting a length of 0

when I hardcode the above 2 literals into the length function: Len(Dir("C:\winnt\pls120")
I get a length of 15 which is true.
Is there something that I need to do to the 2 strings before using them as variables in the Dir function? Bob Schmid
bob_schmid@hmis.org
330-746-1010 ext. 1347
 
The problem is that you have a "\" just sitting there, between the 2 unconnected to the string variables you've already got.

This will concatenate the 2 strings with the "\"...
Len(Dir(windir & "\" & stfile, lngType))


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top