| View previous topic :: View next topic |
| Author |
Message |
Duckdude227 Newbie
Joined: 07 Jun 2005 Posts: 6
|
Posted: Jun 8th, 2005 06:49 PM Post subject: Dir list |
|
|
I am trying to get a dropdown box that has a list of dirictories in it. _________________ There are 10 types of people in this world, those who understand binary and those who don't.
 |
|
| Back to top |
|
rbgCODE Regular
Joined: 11 Nov 2004 Posts: 54 Location: Manchester CT
|
Posted: Jun 13th, 2005 01:57 PM Post subject: |
|
|
| Code: |
Function ExtractAll(ByVal FilePath As String, Optional DefaultExtension As String = "*.*") As String
Dim i, t
Dim RetVal As String
Dim MyName As String
Dim SubDir(500) As String
Static cnt As Long
If Mid$(FilePath, Len(FilePath), 1) <> "\" Then
FilePath = FilePath + "\"
End If
i = 0
On Error GoTo nodir
MyName = Dir(FilePath, vbDirectory)
Do While MyName <> ""
If MyName <> "." And MyName <> ".." And MyName <> "Directories" Then
If (GetAttr(FilePath & MyName) And vbDirectory) = vbDirectory Then
SubDir(i) = MyName
i = i + 1
End If
End If
MyName = Dir
Loop
DoEvents
If bolStop = True Then GoTo cExit
MyName = Dir(FilePath + DefaultExtension, vbNormal)
Do While MyName <> ""
If Right(LCase(MyName), 3) = Right(txtExtension, 3) Then
RetVal = RetVal + FilePath + MyName + "^"
cnt = cnt + 1
Status.Panels(1).Text = "Searching files " + cnt
Status.Refresh
DoEvents
End If
MyName = Dir
Loop
nodir:
Dim RetVal2 As String
For t = 0 To i - 1
RetVal2 = RetVal2 + ExtractAll(FilePath & SubDir(t) + "\")
Next t
cExit:
ExtractAll = RetVal + RetVal2
Exit Function
End Function
|
_________________ '><>
'rBg
'><> |
|
| Back to top |
|
Duckdude227 Newbie
Joined: 07 Jun 2005 Posts: 6
|
Posted: Jun 13th, 2005 03:19 PM Post subject: |
|
|
When i tried that it gave me a lot of errors and didn't work. _________________ There are 10 types of people in this world, those who understand binary and those who don't.
 |
|
| Back to top |
|
|