Description |
The GetCurrentDir procedure returns a string containing the drive plus path name of the current directory.
|
|
Related commands |
|
|
|
Example code : Getting the current directory |
// Full Unit code. // ----------------------------------------------------------- // You must store this code in a unit called Unit1 with a form // called Form1 that has an OnCreate event called FormCreate. unit Unit1; interface uses SysUtils, // Unit containing the GetCurrentDir command Forms, Dialogs; type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); end; var Form1: TForm1; implementation {$R *.dfm} // Include form definitions procedure TForm1.FormCreate(Sender: TObject); var
dir : string;
begin // Get the current directory
dir := GetCurrentDir;
ShowMessage('Current directory = '+dir);
end; end.
|
Hide full unit code |
Current directory = C:\Program Files\Borland\Delphi7\Projects
|
|