HB_FNameName

HB_FNameName

Extracts file name portion of a file specification

Syntax

      HB_FNameName( <cFileSpec>  --> <cFileName>

Arguments

<cFileSpec> : a character string to extract file name

Returns

<cFileName> : file name ( without extension ) portion of <cFileSpec>

Note

<cFileSpec> may or may not include an ordinary file name at end. Function returns simply last element of <cFileSpec>

Description

This function is used to extract only file name from a qualified file specification string <cFileSpec> doesn’t require include an existing file / path info. This info can be optained by :

        cFName  := ''
        HB_FNameSplit( cFileSpec, , @cFName )
          ? cFName
      OR
        cNamExt := SUBSTR( cFileSpec, RAT( "\", cFileSpec ) + 1 )
         ? IF( "." $ cNamExt, LEFT( cNamExt,  RAT( ".", cNamExt ) -1 ), cNamExt )

Example

      ? HB_FNameName( "c:\temp\NewDirDB" )          // NewDirDB
      ? HB_FNameName( "c:\temp\NewDirDB\test.bat" ) // test

Seealso

HB_FNameDir(), HB_FNameNameExt(), HB_FNameExt(), HB_FNameExtSetDef(), HB_FNameMerge(), HB_FNameSplit()

<

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.