Topic: Listing subfolders and files

Hello Dmitry and all MVD fans,


Well... usually I manage to find my way around scripting in MVD, but this time I'm clueless sad


I want to
- let the user choose a directory
- build a list of sub-folders and files in the chosen directory recursively if possible


This list can be displayed in a memo or whatever, once I have it I'll do what's needed with it.


I've searched a lot on that subject and found examples, but they all use TSearchRec, FindFirst, FindNext and FindClose...


Do any of you already coded something like this ?


Help much appreciated


Cheers


Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: Listing subfolders and files

Maybe I was not precise enough : I known how to open a dialog and choose a directory and I also know how to use the 'GetFileList' function.


I don't known how to search recursively in subfolders and I find it 'heavy' to use a TStringList to get each file and search for it's extension and so on.


Do you known about another solution ?


Cheers


Math

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: Listing subfolders and files

You can use function
to get file name

  ExtractFileName()

to get file extension

  ExtractFileExt()
Dmitry.