Home All Groups Group Topic Archive Search About

List proceedure names all files

Author
19 Nov 2007 8:41 PM
MP
Sorry, another dumb noob question!
:-|

over the past years of my attempts to learn vb I've amassed thousands of
files in my code folder<s>
many are probably more or less duplicate proceedures with revisions over
time, renamed, then forgotten, then rewritten again,
:-(

I would love to trim down all the old junk and get rid of what's not useful.

To that end I was thinking of how to find duplicate (and / or similar
proceedure names) in various files
so I can at least get an idea of what files I could get rid of or merge into
a common file...

so my thought was,
For Each file in folder,
     ListProceedureNamesInFile File
        For each ProceedureName in list
            GetListOfFilesContaining ProceedureName

naturally I don't want to loop through all files multiple times
so I thought I could loop through files once,
store proc names and their parent filename in a database
then use a Select / Where sql process to find duplicates/similarities
to generate some kind of report to textfile or listview or treeview or
flexgrid or something???/

does anyone have suggestions on viable design concept for something like
that?

Thanks,
Mark

Author
20 Nov 2007 3:18 AM
MP
"MP" <NoSpam@Thanks.com> wrote in message
news:OdYDLyuKIHA.5224@TK2MSFTNGP02.phx.gbl...
> Sorry, another dumb noob question!
> :-|

ok, so like i said it was a dumb question...
:-)

fwiw (very little<g>)
I did the following
loop through files
store proc names and filename in database
use a Select / Where to find duplicates/similarities
for now just logging results to text file
it does give an interesting glimpse into my garbage collection
<vbg>


still interested in anyones' opinion of a better way,
Thanks
Mark
Author
20 Nov 2007 3:21 AM
Bob Butler
"MP" <NoSpam@Thanks.com> wrote in message
news:e8eBKQyKIHA.748@TK2MSFTNGP04.phx.gbl...
> still interested in anyones' opinion of a better way,

using a database may be overkill; a collection or an array could be used for
this.  How many files are you talking about?
Author
20 Nov 2007 7:12 AM
MP
"Bob Butler" <noway@nospam.ever> wrote in message
news:%23I2ZcSyKIHA.4196@TK2MSFTNGP04.phx.gbl...
> "MP" <NoSpam@Thanks.com> wrote in message
> news:e8eBKQyKIHA.748@TK2MSFTNGP04.phx.gbl...
>> still interested in anyones' opinion of a better way,
>
> using a database may be overkill; a collection or an array could be used
> for this.  How many files are you talking about?
>
probably but it gives me an excuse to practice with some more database tasks
:-)

filtering for *.cls;*.bas;*.frm...
2025 files to process...

You're right, I could probably use a dhSortedDictionary just as easily as a
db.
in fact I collect the  data into a collection before putting in db (using a
little cProcData class)
If i change the FileName property (in cProcData) to FileList (delim string)
I can just append filenames as I find matches to the ProcName

I'll play around with that idea too
Thanks
Mark
Author
20 Nov 2007 2:37 PM
Bob Butler
"MP" <NoSpam@Thanks.com> wrote in message
news:eFV4sS0KIHA.5920@TK2MSFTNGP03.phx.gbl...
> You're right, I could probably use a dhSortedDictionary just as easily as
> a

a dhSortedDictionary?
Author
20 Nov 2007 3:41 PM
MP
"Bob Butler" <noway@nospam.ever> wrote in message
news:eb2qJM4KIHA.4752@TK2MSFTNGP05.phx.gbl...
> "MP" <NoSpam@Thanks.com> wrote in message
> news:eFV4sS0KIHA.5920@TK2MSFTNGP03.phx.gbl...
>> You're right, I could probably use a dhSortedDictionary just as easily as
>> a
>
> a dhSortedDictionary?
>
>

yep, posted here by Olaf Schmidt some time back
www.datenhaus.de/Downloads/dhSortedDictionary.zip

replaces the ...shudder... Scripting.Dictionary and vb collection and then
some
makes any use I ever had for a dictionary extremely easy
(eliminates all the sorting code etc)

:-)
highly tuned and just way cool.

I figured everyone was using em by now <g>

AddThis Social Bookmark Button