|
Previous Top Next |
Prototype: | (String pFilename, Byte pPart),String |
pFileName | The name, with or without path, of the file. |
pPart | Defines what part of the filename you want returned. The parts available are FNS_Drive, FNS_Path, FNS_File and FNS_Ext. Additional combined parts are FNS_FullPath which returns the drive and path, FNS_FileName which returns the filename and extension and FNS_FullPathFile which returns the drive, path and filename, but not the extension. You can add them up to match any parts you want. |
Returns | The part of the filename determined by the pPart. |
This method returns the part of a full path filename that you request in the pPart parameter. This is a very useful function when dealing with filenames as it allows you to specify what parts you need. Also note the SplitFileParts method which splits all parts of a filename into the FileParts group.
Example:
F CString(1025)
Fn CString(1025)
ITC ITCoreClass
Code
F = 'C:\Clarion\Apps\Test\GetFilePart\GetFilePart.app'
Fn = ITC.GetFilePart(F,FNS_Drive+FNS_Path)
! Returns: 'C:\Clarion\Apps\Test\GetFilePart\'
Fn = ITU.GetFilePart(F,FNS_Path)
! Returns: \Clarion\Apps\Test\GetFilePart\'
Fn = ITU.GetFilePart(F,FNS_File)
! Returns: 'GetFilePart'
Fn = ITU.GetFilePart(F,FNS_Ext)
! Returns: '.app'
Fn = ITU.GetFilePart(F,FNS_File+FNS_Ext)
! Returns: 'GetFilePart.app'
Fn = ITU.GetFilePart(F,FNS_Drive+FNS_Path+FNS_File)
! Returns: 'C:\Clarion\Apps\Test\GetFilePart\GetFilePart'
Fn = ITU.GetFilePart(F,FNS_Drive+FNS_Path+FNS_File+FNS_Ext)
! Returns: 'C:\Clarion\Apps\Test\GetFilePart\GetFilePart.app'
Fn = ITC.GetFilePart(F,FNS_FullPath)
! Returns: 'C:\Clarion\Apps\Test\GetFilePart\'
Fn = ITC.GetFilePart(F,FNS_FileName)
! Returns: 'GetFilePart.app'
Fn = ITC.GetFilePart(F,FNS_FullPathFile)
! Returns: 'C:\Clarion\Apps\Test\GetFilePart\GetFilePart'
[****]
See also: