Quote Originally Posted by Dr Unne
This is an example of something which someone else somewhere in the world already wrote, tested, debugged, and left lying around on the internet. Re-using other people's source code is a good thing, in almost every case. So long as the source code is good quality.

"Reinventing the wheel", you've probably heard that term before; a lot of programmers reinvent the wheel on a nearly hourly basis. Your code only handles one specific kind of path, which is an artificial and fairly severe limitation. If you found a standard library for parsing filenames, you could handle any sort of path you want. Perl, for example, has File::Basename, which can handle filenames from Unix, Windows, AIX, VMS, and AmigaOS.

Another good thing about code reuse is that you don't have to care about that code. If there's a bug in the filename parsing code, it's not your problem. You're doing fileparse($my_filename), and that's it. You update your File::Basename module (or whatever) and your one line of code still works without having to change anything at all.
Agreed, but this isn't a case where I have the time to learn Perl. I just wanted a haphazardly created (quite literally...you should see the actual program) program. And you know what? You can drag and drop media files on the mplayer executable anyway, thus making my program completely pointless and excessive. :p

But I didn't know that to begin with, so etiher way even if I were to use Perl I would be making an excessive program :D

Quote Originally Posted by Samuraid
Cool. Actually I was suggesting:

If Right(pathstring, 1) <> "\" Then
pathstring = pathstring & "\"
End If

But it's good you got it figured out anyway.
See the thing was that I didn't know what the number parameter did. Now I do. :D