PATH.Split |
![]() ![]() |
string = PATH.Split( file-name AS STRING, part AS INTEGER ) AS STRING
Returns specified part(s) of a Windows file specification. You can specify more than one part by adding the constants. The parts are defined as
CONST EL_Drive = 0x00000001 CONST EL_Directory = 0x00000002 CONST EL_Filename = 0x00000004 CONST EL_Extension = 0x00000008
Example:
DIM s AS STRING
$INCLUDE "MyBASIC2_ExtLib.bas" $LIBRARY "MyBASIC2_ExtLib.dll"
s = FILE.GETOPENFILENAME( "AVI Files (*.avi)|*.avi|All Files (*.*)|*.*||", 2, "Hello", 0 )
PRINT "GetOpenFileName=";s, PRINT "Drive =";PATH.Split( s, EL_Drive ), PRINT "Folder=";PATH.Split( s, EL_Directory ), PRINT "Name =";PATH.Split( s, EL_Filename ), PRINT "Ext =";PATH.Split( s, EL_Extension ),
PRINT "Make Path: ";PATH.Make( PATH.Split( s, EL_Drive ),_ PATH.Split( s, EL_Directory ),_ PATH.Split( s, EL_Filename ),_ PATH.Split( s, EL_Extension ) ),
PRINT "Make Path: ";PATH.Make( PATH.Split( s, EL_Drive ),_ PATH.Split( s, EL_Directory ) ),
END
|