DelphiBasics
GetCurrentDir
Function
Get the current directory (drive plus directory) SysUtils unit
 function GetCurrentDir : string;
Description
The GetCurrentDir procedure returns a string containing the drive plus path name of the current directory.
Related commands
ChDir Change the working drive plus path for a specified drive
CreateDir Create a directory
GetDir Get the default directory (drive plus path) for a specified drive
MkDir Make a directory
RemoveDir Remove a directory
RmDir Remove a directory
SelectDirectory Display a dialog to allow user selection of a directory
SetCurrentDir Change the current directory
ForceDirectories Create a new path of directories
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 Download this web site as a Windows program.




 
Example code : Getting the current directory
var
  dir : string;

begin
  // Get the current directory
  dir := GetCurrentDir;
  ShowMessage('Current directory = '+dir);
end;
Show full unit code
   Current directory = C:\Program Files\Borland\Delphi7\Projects
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Home Page