Find ALL files in a directory

In this category you can exchange your programming questions and solutions.
Post Reply
Darren
Posts: 63
Joined: Wed May 11, 2011 11:55 am

Find ALL files in a directory

Post: # 751Post Darren
Thu Aug 11, 2011 10:15 am

Can anybody help?

Say that you have a folder with hundreds of notepad "txt" files. How, using FindFirst$ & FindNext$, can I list them to a ListBox. I have tried but I am having trouble with FindNext$. It seems to "skip" files.

Does anybody have an example?

Many thanks in advance!!!

Darren

Quartermars
Posts: 11
Joined: Thu Jul 30, 2009 10:41 am

Find ALL files in a directory

Post: # 752Post Quartermars
Thu Sep 29, 2011 10:26 am

[quote author=7A607C70727E130 link=1313057733/0#0 date=1313057733]Can anybody help?

Say that you have a folder with hundreds of notepad "txt" files. How, using FindFirst$ & FindNext$, can I list them to a ListBox. I have tried but I am having trouble with FindNext$. It seems to "skip" files.


Well you can try this example....I know it has worked for me...
sub DirectoryListing()
     Dim TempStr as string
     RichWin.text=Findfirst$("*.txt")
     do
     TempStr = FindNext$
     RichWin.text=RichWin.text + chr$(10)+TempStr
     loop until TempStr=""
end sub

Does anybody have an example?

Many thanks in advance!!!

Darren[/quote]

Post Reply