JavaScript Editor js editor     Web development 



Main Page

Returns the current directory.

CURDIR([cExpression])

Parameters

cExpression


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.

Return Value

Character

Remarks

CURDIR(В ) returns, as a character string, the current MS-DOS directory on a specified drive.

Example

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.

В Copy Code
CLEAR
? 'Current directory: ', CURDIR( )
gcOldDir = SET('DEFAULT') + SYS(2003)
SET DEFAULT TO (HOME( ))
? 'Visual FoxPro directory: ', CURDIR( )
SET DEFAULT TO (gcOldDir)
? 'Current directory: ', CURDIR( )

See Also



JavaScript Editor js editor     Web development