Blitz3D+ Command Reference

RequestDir$ ( [prompt$][,path$] )

Parameters

prompt$ (optional) - title text for the dialog; "" uses the standard title (default)

path$ (optional) - folder the dialog starts in; "" starts in the default location (default)

Description

Opens a folder picker and returns the chosen directory path, or an empty string on cancel.

Requires Extended language mode.

This is the modern Windows folder dialog - the same one Explorer-style apps use - so the user can browse, search and create folders. Typical tool uses: picking an export directory for a level, or the root of a project's asset folder.

Always test the result before using it:

folder$=RequestDir("Choose the export folder","C:\Games")
If folder$<>"" Then SaveLevelTo folder$

The returned path is a full UTF-8 path without a trailing slash. The dialog is modal, owned by your active GUI window, and posts begin/end-modal events ($2004/$2005) to the shared event queue. If path$ is not valid path text for this system the call stops with a runtime error describing the problem.

See also: RequestFile, Notify, Confirm.

Index