|
-
Jan 4th, 2000, 01:56 AM
#1
Thread Starter
Hyperactive Member
the 2nd time you use dir(), you don't specify you want only files... (or, alternatively, you don't check if it's a directory before you print it...)
-
Jan 4th, 2000, 04:50 AM
#2
Silly me!! You'd think I'd have spotted that, wouldn't you!!! Cheers.
------------------
Matthew Ralston
E-Mail: [email protected]
ICQ:31422892
Web Sites:The Blue Link My Home Page
-
Jan 4th, 2000, 05:45 AM
#3
Ok, I've added this bit to the second Dir$ statemets (for the files)...
vbNormal + vbHidden + vbReadOnly + vbSystem + vbArchive
...but it still reports many of the ordinary files as being folders. What's going on?!
------------------
Matthew Ralston
E-Mail: [email protected]
ICQ:31422892
Web Sites:The Blue Link My Home Page
-
Jan 4th, 2000, 12:26 PM
#4
I've got a direcotry listing function that I'm using as part of a Telnet Server I'm making, but when I execute it many items get duplicated and some get reported as both files and folders... Any Ideas why?
Code:
Private Sub Dir_List()
Dim sLine As String, iFiles As Integer, iFolders As Integer
debug.print vbCrLf
' Folders
sLine = Dir$("*.*", vbDirectory)
Do Until sLine = ""
debug.print sLine & vbTab & vbTab & vbTab & "<dir>" & vbCrLf
sLine = Dir
iFolders = iFolders + 1
Loop
' Files
sLine = Dir$("*.*")
Do Until sLine = ""
debug.print sLine & vbCrLf
sLine = Dir
iFiles = iFiles + 1
Loop
debug.print "-----------------" & vbCrLf
debug.print iFiles & " file(s), " & iFiles & " folder(s)." & vbCrLf & vbCrLf
End Sub
------------------
Matthew Ralston
E-Mail: [email protected]
ICQ:31422892
Web Sites:The Blue Link My Home Page
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
|