-
Nov 22nd, 2000, 09:06 AM
#1
Thread Starter
Black Cat
Is there a way to get all the files (full file name strings) in a given directory into an array without using the File System Object. I would do a for each loop on the array. Also, I do not need recursion, there's no need to get any directories in the given directory, just the files.
Thanks,
Josh
-
Nov 22nd, 2000, 09:12 AM
#2
Fanatic Member
..search
do a search on this site with some keywords...
u'll find something
-
Nov 22nd, 2000, 09:39 AM
#3
Fanatic Member
Not nearly so tired now...
Haven't been around much so be gentle...
-
Nov 22nd, 2000, 09:45 AM
#4
Hyperactive Member
Put a command button on a form and put this code in it's click event:
Code:
Private Sub Command1_Click()
Dim arrFileHolder() As String
Dim strFileName As String
Dim intArrayIndex As Integer
intArrayIndex = 0
strFileName = Dir("C:\windows\desktop\")
While strFileName <> ""
ReDim Preserve arrFileHolder(intArrayIndex + 1)
arrFileHolder(intArrayIndex) = strFileName
strFileName = Dir
intArrayIndex = intArrayIndex + 1
Wend
Dim times As Integer
For times = 0 To intArrayIndex
Debug.Print arrFileHolder(times)
Next times
End Sub
Then, look in your Debug window...You'll see all of your files on your desktop...
Hope that helps...
Morgan
-
Nov 22nd, 2000, 10:14 AM
#5
Thread Starter
Black Cat
Thanks, that's what I needed. Combining that with a few API calls I can remove a form and scrrun.dll from my program.
Josh
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
|