GETDIR

Format

string1=GETDIR (number1)

Description

This statement is used to retrieve the current DOS directory. Number1 should be set to "0" to obtain the directory for the current drive, "1" for the "A" drive, "2" for the "B" drive, etc. If the statement is unsuccessful, the system ERROR variable will be set. A complete list of ERROR codes is contained in the Error Code Chapter of the ASIC Manual. The directory string will be stored in string1. The directory string will not contain the drive letter, or the first "\". Thus, if the current directory on the specified drive was "C:\ASIC", then GETDIR would return "ASIC". If the current directory was the root (e.g., "C:\"), then GETDIR would return a NULL string ("").

Example

A$=GETDIR(0)
After execution of this statement, the variable A$ will contain the name of current directory on the current disk drive.

See Also

  • FIND
  • MDKIR
  • RMDIR
  • CHDIR
  • GETDRIVE