title: Conversion between absolute and relative paths in Delphi
body: <p>Are there standard functions to perform absolute &lt;--> relative path conversion in Delphi?</p>
  
  <p>For example:</p>
  
  <ul>
  <li>'Base' path is <code>'C:\Projects\Project1\'</code></li>
  <li>Relative path is <code>'..\Shared\somefile.pas'</code></li>
  <li>Absolute path is <code>'C:\Projects\Shared\somefile.pas'</code></li>
  </ul>
  
  <p>I am looking for something like this:</p>
  
  <pre><code>function AbsToRel(const AbsPath, BasePath: string): string;
  // '..\Shared\somefile.pas' =
  //   AbsToRel('C:\Projects\Shared\somefile.pas', 'C:\Projects\Project1\')  
  function RelToAbs(const RelPath, BasePath: string): string;
  // 'C:\Projects\Shared\somefile.pas' =
  //   RelToAbs('..\Shared\somefile.pas', 'C:\Projects\Project1\')  
  </code></pre>