Forklaring af kode!!
Jeg har opsnuset en kodestump der gennemløber mine filerne på computeren men er der nogen der kan gennemgå den så jeg kan forstå den:Public Sub DirWalk(ByVal sPattern As String, ByVal CurrDir As String)
If IsRunning = False Then Exit Sub
Select Case (Right$(CurrDir, 1) <> \"\\\")
Case True: Dir1.Path = CurrDir & \"\\\"
Case False: Dir1.Path = CurrDir
End Select
lblCurrPath.Caption = \"Searching: \" & CurrDir
For I = 0 To Dir1.ListCount
If Dir1.List(I) <> \"\" Then
DoEvents
Call DirWalk(sPattern, Dir1.List(I))
Else
Select Case (Right$(Dir1.Path, 1) = \"\\\")
Case True: sCurrPath = Left(Dir1.Path, Len(Dir1.Path) - 1)
Case False: sCurrPath = Dir1.Path
End Select
File1.Path = sCurrPath
File1.Pattern = sPattern
If IsRunning = False Then Exit Sub
If File1.ListCount > 0 Then
For ii = 0 To File1.ListCount - 1
strFile = sCurrPath & \"\\\" & File1.List(ii)
lstFound.AddItem strFile
If WriteLogFile And IsRunning Then Print #1, strFile
If DeleteFiles = True Then Kill strFile
lblInfo.Caption = \"Files found (\" & lstFound.ListCount & \"):\"
Next
End If
iLen = InStrRev(Dir1.Path, \"\\\")
Dir1.Path = Mid(Dir1.Path, 1, iLen)
End If
If IsRunning = False Then Exit Sub
Next
If IsRunning = False Then Exit Sub
End Sub
