HB_FNameExtSet

HB_FNameExtSet

Change file extension part of a file specification string

Syntax

      HB_FNameExtSet( <cFileSpec>, <cNewExt>  --> <cNewFileSpec>

Arguments

<cFileSpec> : a file specification string to change file extension part

<cNewExt> : New file extension

Returns

<cNewFileSpec> : File extension changed version of <cFileSpec>

Description

This function is used to change file extension portion of a file specification string.

This can be made by :

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

Example

      cFileSpec := "c:\temp\test.prg"
      ? HB_FNameExtSet( cFileSpec, '.ini' )  // c:\temp\test.ini

Seealso

HB_FNameDir(), HB_FNameName(), HB_FNameNameExt(), HB_FNameExt()

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s