xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_FNameMerge()

Composes a file name from individual components.

Syntax

HB_FNameMerge( [<cPath>]     , ;
               [<cFileName>] , ;
               [<cExtension>]  ) --> cResult

Arguments

<cPath>
This is a character string holding the path component for a file.
<cFileName>
This is a character string holding the name component for the file.
<Extension>
This is a character string holding the file extension.

Return

The function returns a character string containing all components passed to the function. When no parameter is passed, an empty string ("") is returned.

Description

Function HB_FNameMerge() is used to build a full qualified file name from individual components. They can be obtained by calling HB_FNameSplit().

Info

See also:CurDir(), CurDrive(), Directory(), File(), HB_FNameSplit()
Category: Character functions , File functions , xHarbour extensions
Source:rtl\fnsplit.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The function splits a full qualified file name and
// merges different components

   PROCEDURE Main
      LOCAL cString := "C:\xhb\source\data\test.dbf"
      LOCAL cPath, cFileName, cExtension

      HB_FNameSplit( cString, @cPath, @cFileName, @cExtension )

      ? HB_FNameMerge( , cFileName, cExtension )
      // result: test.dbf

      ? HB_FNameMerge( cPath, cFileName )
      // result: C:\xhb\source\data\test
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe