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
ChDirChange the working drive plus path for a specified drive
CreateDirCreate a directory
GetDirGet the default directory (drive plus path) for a specified drive
MkDirMake a directory
RemoveDirRemove a directory
RmDirRemove a directory
SelectDirectoryDisplay a dialog to allow user selection of a directory
SetCurrentDirChange the current directory
ForceDirectoriesCreate a new path of directories
 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 . All rights reserved.  |  Home Page