www.icetips.com  Icetips Utilities Documentation 5/9/2015    

Core Class: GetFilePart

Previous  Top  Next  


Prototype: (String pFilename, Byte pPart),String

 

pFileNameThe name, with or without path, of the file.

 

pPartDefines 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.

 

ReturnsThe 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:

SplitFileParts

 

 

 



Direct link to this page: http://www.icetips.com/manuals/utilities/getfilepart_core.htm