|
-
Dec 4th, 2000, 10:29 PM
#1
Thread Starter
Junior Member
I got that function from here but I get ann error "subscript out of range" what`s up with that ??
'recursive folder adding
Public Sub ProcessFiles(d As String)
Playlist.files.AddItem Playlist.files.ListCount + 1 & ". " & d
End Sub
Public Sub ProcessDir(strDir As String)
Dim i
Dim iCount As Integer
Dim Result As String
Dim FileList() As String
iCount = 0
Result = Dir(strDir & "\*.*", vbDirectory)
Do While Result <> "" ' Start the loop.
If Result <> "." And Result <> ".." Then
iCount = iCount + 1
ReDim Preserve FileList(1 To iCount)
FileList(iCount) = strDir & "\" & Result
End If
Result = Dir
Loop
For i = 1 To UBound(FileList)
If (GetAttr(FileList(i)) And vbDirectory) = vbDirectory Then
ProcessDir (FileList(i))
Else
ProcessFiles (FileList(i))
End If ' it represents a directory.
Next
End Sub
give me the handle and I`ll give you the world
Adam
junior programmer
-
Dec 4th, 2000, 11:26 PM
#2
transcendental analytic
on what line?
It happens if you
1. assign or try to return a value from an array where the index out of the bounds of it. like a(4)=5 when a(1 to 3)
2. assign or try to return a value from an empty array
3. using ubound or lbound on empty arrays.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 5th, 2000, 07:24 AM
#3
Thread Starter
Junior Member
For i = 1 To UBound(FileList)
that`a where I get the error
give me the handle and I`ll give you the world
Adam
junior programmer
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
|