Returns a relative path name, relative to a specific base directory.
function ExtractRelativePath(const BaseName: string; const DestName: string): string;
AnsiString ExtractRelativePath(const AnsiString BaseName, const AnsiString DestName);
SysUtils
Call ExtractRelativePath to convert a fully qualified path name into a relative path name. The DestName parameter specifies file name (including path) to be converted. BaseName is the fully qualified name of the base directory to which the returned path name should be relative. BaseName may or may not include a file name, but it must include the final path delimiter.
ExtractRelativePath('c:\foo\', 'c:\bar\')
so that it would return
'..\bar\'
.
ExtractRelativePath('c:\foo\', 'c:\bar')
would return the incorrect result, probably like
'..'
.
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|