CURDIR([<C drive letter>])
Gets name of current disk directory.
Returns <expC> current directory of specified or default drive.

m_dir = CURDIR()
m_file = SPACE(12)
@ 12,10 SAY "Enter name of file: " GET m_file
READ
IF .NOT. FILE( m_file )
? "File " + m_file + " not found in directory " + m_dir
ENDIF

* Check validity of specified drive before using CURDIR.
m_drive = SPACE(1)
@ 12,10 SAY "Enter drive letter: ";
GET m_drive VALID ISDRIVE( m_drive )
READ
directory = CURDIR( m_drive )

Hazard
Assumes that you have checked to make sure the optionally
specified disk drive is valid. If the optional drive letter
is included, the code should check ISDRIVE() first.
Specifying an invalid drive, such as "B" on a single-floppy
system, can cause serious errors, including
computer lock-up and data destruction.


Placed in the Public Domain by Tom Rettig Assoc.