String methods in script: how to get parent folder of file?
Posted: 03 Jan 2023, 19:22
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;
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;