Home > Language Reference > User Dialog Functions > SelectDir$

SelectDir$

The SelectDir$ function displays the standard Browse for Folder dialog box and returns the user selection.

Usage

Used to prompt the user to select a folder.

Syntax

var$=SelectDir$(<prompt>, <initial_folder>, <flag>)

Parameters

<prompt>, string, prompt to display in the dialog box.

<initial_folder>, string, name of the initial folder to open. If the specified folder is invalid, the default folder is My computer.

<flag>
, integer, indicates which type of resources are listed in the dialog box. The 1 value is recommended, which lists only the folders. The value 2 is for browsing network neighborhood. The value 8192 is for browsing printers.

Return value

var$, string, folder name selected by the user.

Remarks

To provide a system-independent folder name which may not have the same name or location on any given system, you can use for <initial_folder> a CSIDL value used in C++.

See also

SelectFile

Example

' Folder selection starting at C:\wttest
mydir$=selectdir$("Select a folder","C:\wttest",1)
msgbox(mydir$)