DirName

DirName

Returns the current directory name

Syntax

      DirName( [<cDrive>] ) --> <cCurDirName>

Argument

<cDrive> : Designates the drive for which the current directory is determined (a colon is unnecessary). The default is the current drive.

Return

<cCurDirName> : name of the current directory as a character string. The string does not include a drive letter.

Description

DirName() determines the current directory name on the selected drive. You can use this function to construct complete access paths.

Note

DirName() seem as a synonim of CurDir() and doesn’t support <cDrive> properly

Example

      ? '  ->', DirName(), CurDir()              //    -> \temp temp
      ?
      ? DirChange( 'C:\TEMP' )                   //           0
      ? DirChange( 'D:\TEMP' )                   //           0
      ? DirChange( 'E:\TEMP' )                   //           0
      ?
      ? 'C ->', DirName( 'C' ), CurDir( 'C' )    //  C -> \
      ? 'D ->', DirName( 'D' ), CurDir( 'D' )    //  D -> \
      ? 'E ->', DirName( 'E' ), CurDir( 'E' )    //  E -> \
      ?                                          //
      ? 'C:->', DirName( 'C:' ), CurDir( 'C:' )  //  C:-> \
      ? 'D:->', DirName( 'D:' ), CurDir( 'D:' )  //  D:-> \
      ? 'E:->', DirName( 'E:' ), CurDir( 'E:' )  //  E:-> \

Files

lib : hbct

Seealso

CurDir(), DirChange(), DirMake(), DirRemove()

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.