www.icetips.com  Icetips Utilities Documentation 11/14/2010    

File Search Class:  GetLevel

Previous  Top  Next  


Prototype: (String pDir),Byte

 

pDirDirectory (folder) name to check. 

 

ReturnsReturns the number of directory levels deep the folder is.

 

This method is used by the ReadDirectories method to get the level of directories.  The level is stored in the SubLevel field of the Directories property and makes it easy to construct a directory tree as the level is already known.  What this method does is simply loop through the pDir string and count the number of backslashes that are in it.  It can also be used as standalone without any other methods in this class being called.

 

Example:

ITF   ITFileSearchClass

P     CString(256)

Level Byte

Code

P = 'C:\Clarion\3rdParty\Template'

Level = ITF.GetLevel(P)  !! Returns 3 as the "Template" is the third level from the root (three '\' found)

 

 

See also:

Directories

ReadDirectories

 



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