TDirectoryExists (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example, demonstrates the existance of a directory, whose path is specified in an edit box. Pressing the button, a meesage box will appear to specify if the directory exists or not.

Code

procedure TForm1.Button1Click(Sender: TObject);
begin
  { Verify whether the specified directory exists }
  if TDirectory.Exists(Edit1.Text) then
    MessageDlg('The directory exists!', mtInformation, [mbOK], 0)
  else
    MessageDlg('The directory does not exists!', mtInformation, [mbOK], 0)
end;

Uses