ChangeFileExt
Delphi has a lot of functions to split a file name into the path component and file name component but to get the file name without the extension seems to be a non trivial task at first.
To extract just the file name without the extension use ChangeFileExt and pass in an empty string as the second parameter. This will remove the extension and return just the file name part.
Make the common case easier than the rare case.
Make the common case easier than the rare case, it seems like simple advice but this is well written as to explain it to new developers.
Code is twice as hard to debug as it is to write. if you write clever code then be denifition you are not smart enough to debug it.
By making the common case easier other developers will reuse your code. If you make the common case too difficult other developers wont reuse the code as it is too hard. Which defeats the purpose of writing it in the first place.