I'd like to get the parent path of a file. so HH/mystuff/myfile.txt would return HH/mystuff.
I'm not finding much in the docs that's useful. I see a 'pos' command that could be used to find path delimiters, but not sure how to get the location of the last delimiter.
Also no substring methods I can see in the docs, although I think I've scoured delphi resources before and found some things that worked...
Guess I'll dig through old scripts and see what I can turn up.
EDIT:
DOH! should have looked for file methods. I'm assuming this will do it: function ExtractFilePath(const FileName: String): String;
String methods in script: how to get parent folder of file?
-
woodslanding
- Member
- Posts: 1327
- Contact:
String methods in script: how to get parent folder of file?
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
top+++
Olivier Sens
www.brainmodular.com
www.brainmodular.com
-
woodslanding
- Member
- Posts: 1327
- Contact:
One tiny related bug? fr?
I note that when a file does not have an extension, ExtractFileExtension returns the entire filename, instead of an empty string. Not too hard to work around, but not what I would expect....
I note that when a file does not have an extension, ExtractFileExtension returns the entire filename, instead of an empty string. Not too hard to work around, but not what I would expect....
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Who is online
Users browsing this forum: Bing [Bot] and 86 guests
