browseForFolder

browseForFolder(caption:     String;
                startFolder: String): String;

The browseForFolder method of the FileFolder class displays the common File dialog and returns the folder whose name is specified in the caption parameter. The search for the folder starts in the folder (directory) specified in the startFolder parameter.

The Folder text box is displayed below the directory list box, so that the user can specify the name of the required folder, using a standard (common) Microsoft dialog.

In thin client mode, this method always runs on the presentation client.

The method shown in the following example initializes the database from text files.

vars
    dataLoader : InitialDataLoader;
    fileFolder : FileFolder;
    dirPath    : String;
begin
    // Ask for the directory containing the initial data files
    create fileFolder transient;
    dirPath := fileFolder.browseForFolder("Select data file directory",
                                          app.dbPath);
    if dirPath <> null then
        // Create the data loader and initialize the database
        create dataLoader transient;
        dataLoader.loadData(dirPath);
    endif;
epilog
    delete dataLoader;     // does nothing if dataLoader is null
    delete fileFolder;     // does nothing if fileFolder is null
end;

See also the FileFolder class browseForServerFolder method, which enables you to browse for and return a folder from the database server node.