Returns the current directory.
- Specifies the drive or volume for which CURDIR(В ) returns the current directory or folder. If you omit cExpression, the current default drive or volume is assumed. The empty string is returned if the drive or volume you specify in cExpression doesn't exist. Note that this argument is only included for earlier versions of Visual FoxPro and FoxPro running under Window 3.1 or MS-DOS.
CURDIR(В ) returns, as a character string, the current MS-DOS directory on a specified drive.
The following example stores the current directory to a variable, sets the default to the directory Visual FoxPro was started in, displays the new directory, returns the default to the original directory, and displays the original directory.
CLEAR ? 'Current directory: ', CURDIR( ) gcOldDir = SET('DEFAULT') + SYS(2003) SET DEFAULT TO (HOME( )) ? 'Visual FoxPro directory: ', CURDIR( ) SET DEFAULT TO (gcOldDir) ? 'Current directory: ', CURDIR( )