|
-
Mar 19th, 2003, 11:29 AM
#1
Thread Starter
Fanatic Member
Using DIR() to show all files in a folder
Using DIR() I got all the files that end with .mp3 (for example) show up in a listbox. How would I loop through the listbox now, checking the first letter of each file? And how would I do it with a comboBox?
-
Mar 19th, 2003, 11:58 AM
#2
Frenzied Member
something like:
VB Code:
For ctr = 0 To List1.ListCount
MsgBox List1.List(ctr)
If Left(List1.List(ctr),1) = "A" then
MsgBox ctr
End if
Next
-
Mar 19th, 2003, 03:25 PM
#3
Thread Starter
Fanatic Member
-
Mar 19th, 2003, 05:03 PM
#4
Originally posted by JordanChris
something like:
VB Code:
For ctr = 0 To List1.ListCount
MsgBox List1.List(ctr)
If Left(List1.List(ctr),1) = "A" then
MsgBox ctr
End if
Next
I think youll need -1 too, like:
VB Code:
For ctr = 0 To List1.ListCount [b]-1[/b]
And... if your dealing String Data Types, use the $ with the
relavent function, like: Left$ - Saves the double conversion by VB.
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
|