| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Splits a file name into individual components.
HB_FNameSplit( <cString> , ;
[@<cPath>] , ;
[@<cFileName>] , ;
[@<cExtension>] ) --> NIL
The function returns always NIL. The components of a file name are assigned to the parameters passed by reference.
Function HB_FNameSplit() is used to split a full qualified file name into individual components. They can be merged later with function HB_FNameMerge().
| See also: | CurDir(), CurDrive(), Directory(), File(), HB_FNameMerge() |
| Category: | Character functions , File functions , xHarbour extensions |
| Source: | rtl\fnsplit.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The function splits a full qualified file name and
// displays the result
PROCEDURE Main
LOCAL cString := "C:\xhb\source\data\test.dbf"
LOCAL cPath, cFileName, cExtension
? HB_FNameSplit( cString, @cPath, @cFileName, @cExtension )
? cPath // result: C:\xhb\source\data\
? cFileName // result: test
? cExtension // result: .dbf
RETURN
http://www.xHarbour.com