problems with treeview (again) [RESOLVED]
This code:
Code:
'create Artist and Album nodes
artist = Mid(str, 1, (dash(0) - 1))
album = Mid(str, (dash(0) + 3), (dash(1) - (dash(0) + 2)))
track = Mid(str, (dash(2) + 3))
Try 'if the 'Artist' node has been created already, erase any subsequent ones so there is only one
If Node.Text = artist Then
Node.Remove()
End If
Catch 'let's just keep on rolling!
End Try
'parent node:
Node = tvw1.Nodes.Add(artist)
'child node:
Node.Nodes.Add(album)
It works excellent and creates a parent node with the Artist's name. If there are more than one instance of that name, it ends up with only one.
However, the child node, which is the album, will only end up with the last album for that artist. It erases the ones prior to it and just shows the last one run across.
What am I missing here to keep ALL albums as child nodes under the correct artist?
I'm beginning to think the code for this project isn't very well optimized. I am writing this for my specifically formatted naming scheme only.
I will put my source code on my ftp server and if anyone is interested, they can look at it and give me some suggestions on how to make it better.
ftp.andrewrichardson.us
goto the "upload here" folder and download mp3 sorter.
you will have to change the source code a tad to use the sample mp3 file I included. Please let me know if you like it or if you have any questions or suggestions..
:bigyello: :wave: