|
-
August 6th, 2001, 12:24 PM
#1
Len function doesn't work correctly!
I used Len function in my program to know the folder exists or not but doesn't work corectly.
Source is like following.
Private Sub Command1_Click()
Dim strSrcDir As String
Dim SrcDirLen As Integer
Dim fs, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set s = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(Drive1.Drive)))
strSrcDir = "C:\Windows\System\"
SrcDirLen = Len(Dir(strSrcDir))
MsgBox "source path = " + strSrcDir + vbCrLf + "Length = " + CStr(SrcDirLen), vbOK
End Sub
If run the program, SrcDirLen becomes 10.
Is it right that SrcDirLen becomes 18?
Len function returns unpredictable value even if input other folder name as the input parameter of the Len function.
Anyone who explain let me know the reason?
Thank you.
I'm a senior programmer.
Working at CamSight, Dental imaging solutions industry.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|