CURDIR$ function

Purpose:

CURDIR$ returns a string containing the full path of the current working directory.

Syntax:

RetStr = CURDIR$

Return Value:

  • Data type: STRING
    RetStr The full path of the current working directory.
    👉 The returned string does not have a terminating backslash unless the current directory is the root of a drive.

Parameters:

  • None.

Example:

DIM AS STRING Curdled

CHDIR "E:\"
Curdled = CURDIR$                      
PRINT Curdled

CHDIR "E:\T"
Curdled = CURDIR$                      
PRINT Curdled

CHDIR "E:"
Curdled = CURDIR$                      
PRINT Curdled

CHDIR "E:\"
Curdled = CURDIR$                      
PRINT Curdled

CHDIR "E:"
Curdled = CURDIR$                      
PRINT Curdled

PAUSE

Result:

E:\
E:\T
E:\T
E:\
E:\

Press any key to continue . . .

BCX Console Sample Programs using the CURDIR$ function.