|
Previous Top Next |
Prototype: | (String pDir),Byte |
pDir | Directory (folder) name to check. |
Returns | Returns 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: