Jeong
August 6th, 2001, 12:24 PM
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.
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.