Viva Clipper !

HB_FNameExt

Advertisements

HB_FNameExt

Extracts file extension portion of a file specification

Syntax

      HB_FNameExt( <cFileSpec>  --> <cFileExt>

Arguments

<cFileSpec> : a character string to extract file extension

Returns

<cFileExt> : file extension portion of <cFileSpec>

Note

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

Description

This function is used to extract path / dir portion of a file specification string. <cFileSpec> doesn’t require include an existing file / path info.

This info can be optained by :

         HB_FNameSplit( cFileSpec, , @cFName, @cFNExt )
         ? cFName + cFNExt
      OR
         IF( "\" $ cFileSpec, SUBSTR( cFileSpec, RAT( ".", cFileSpec ), cFileSpec )

Example

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

Seealso

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

Advertisements

Advertisements