Sign in Join
FPDoc Onlineexperiment

SelectDirectory function

In unit Dialogs

A function that allows a user to select a directory.

Declaration

pascal
function SelectDirectory(const Caption: string; 
 const InitialDirectory: string; 
 out Directory: string): Boolean

Arguments

Caption

A constant which sets the caption of the shown dialog.

InitialDirectory

The directory the dialog should start in.

Directory

A variable which on exit contains the selected directory.

Function result

A boolean indicating if the user pressed OK.

Description

This function will show a dialog which allows the user to select the required directory when the directory structure is displayed as a tree.

Under Windows the caption from the resulting dialog cannot be set, but the label above the directory tree will have this value.

There are two version of this function, the second one having the ability to indicate whether hidden folders should be shown as well.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.