baGetFolder displays a directory dialog box and returns the folder selected.


Windows and Macintosh


Result = baGetFolder( StartDir, Instruction, Flags, Caption, X, Y )


String, string, integer, string, integer, integer.
StartDir is the initial directory. Use "" for the current directory.
Instruction is the instruction to display to the user.
Flags modifies the behaviour of the dialog.
Caption is the caption of the dialog.
X is the horizontal position of the dialog.
Y is the vertical position of the dialog.


Returns the folder selected, or "" if the user cancelled.


folder = baGetFolder( "c:\temp", "Please select a folder to install into:", 1, "Select a folder", -1, 0 )

folder := baGetFolder( "c:\\temp", "Select installation directory", 0, "", 200, 200 )


The flags argument allows you to change the way the dialog box looks and behaves. The following flags are defined.

On Windows, makes the dialog box a 32 bit Explorer style.

Displays a ‘New’ button to allow the user to create a new folder. On Macintosh, the New button will always be shown.

On Windows, use a flag of 3 to display a 32 bit Explorer with a New Folder button.


On Windows, the Caption argument is only used if a 32 bit dialog box is used. If it is an empty string, then the default "Browse for Folder" will be displayed.

On Macintosh, if Caption is not supplied, the default "Choose a Folder" will be used.

The X and Y values are the number of pixels from the top left corner of the screen. Set X to -1 to position the dialog in the center of the calling Director/Authorware window. Set X to -2 to position the dialog in the center of the screen.


See also: