BCXSPLITPATH function

Purpose: BCXSPLITPATH returns a portion of a full path. The portion to be returned is specified by the Pathflag% parameter.


 Syntax:

 RetStr$ = BCXSPLITPATH$(FullPath$, PathFlag%)

 Parameters:

  • RetStr$ Returned string containing a portion of the path.
  • FullPath$ Literal or variable string containing path to be split.
  • PathFlag% One or more flags specifying which portion of the path is to be returned by the function. The flags are
    • FDRV, value 2, returns drive with an appended colon.
    • FPATH, value 4, returns the folder name(s) with backslashes preserved.
    • FNAME, value 8, returns the file name without extension.
    • FEXT, value 16, returns the extension of the file name.
    These flags can be added using the OR operator to return a combined string.

Example :


 DIM FullPath$
 DIM PathFlag%
 DIM RetStr$
 
 FullPath$ = "C:\Folder\FileName.ext"
 
 PathFlag% = FDRV
 RetStr$ = BCXSPLITPATH$(FullPath$, PathFlag)
 PRINT RetStr$
 
 PathFlag% = FPATH
 RetStr$ = BCXSPLITPATH$(FullPath$, PathFlag)
 PRINT RetStr$
 
 PathFlag% = FNAME
 RetStr$ = BCXSPLITPATH$(FullPath$, PathFlag)
 PRINT RetStr$
 
 PathFlag% = FEXT
 RetStr$ = BCXSPLITPATH$(FullPath$, PathFlag)
 PRINT RetStr$

 PathFlag% = FDRV OR FPATH
 RetStr$ = BCXSPLITPATH$(FullPath$, PathFlag)
 PRINT RetStr$

Result:

C:
\Folder\
FileName
.ext
C:\Folder\