|
-
Oct 20th, 2001, 11:28 AM
#1
File and Dir Listing
Hello,
I'm working on a small prog that'll list dirs and the files in them, I used the following code to list the dirs but couldn't get it going with files too:
Code:
Private Sub Command1_Click()
For i = Dir2.ListIndex To Dir2.ListCount - 1
If Text1.Text <> "" Then
Text1.Text = Text1.Text & vbNewLine & Dir2.List(i)
Else
Text1.Text = Dir2.List(i)
End If
Next i
End Sub
Any ideas?
Thanks in advance!
-
Oct 20th, 2001, 11:45 AM
#2
Try this.
VB Code:
sFile = Dir$("C:\MyDir\*.*")
Do While sFile <> ""
Print sFile
sFile = Dir$
Loop
-
Oct 20th, 2001, 02:43 PM
#3
Excuse my ignorence, but I get a run time error 5 (invalid procudure call or argument) on the line.
-
Oct 20th, 2001, 02:49 PM
#4
PowerPoster
Check your code again. It works fine
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
|