RAD Studio VCL Reference
AnsiStrings.ExtractRelativePath Function

Return file path name relative to base name.

function ExtractRelativePath(const BaseName: AnsiString; const DestName: AnsiString): AnsiString; overload;
AnsiString ExtractRelativePath(const AnsiString BaseName, const AnsiString DestName);

ExtractRelativePath returns a file path name from DestName relative to the given BaseName. It strips the common path directories and adds '..\' on Windows, and '../' on Linux for each level up from the BaseName path. 


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!