[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  XPdirTree()
  Traverse the directory tree
------------------------------------------------------------------------------

   Function:   XPdirTree()

               XPdirTree() is a function that use's the
               XPfind..() routines to search the Dir Tree.
               It's powerful and easy to use, the use of Code-Blocks
               makes it possible to do whatever you want with the Output.

               The use of the code-block for the output makes it possible
               for the programmer to store the results he wants in an array,
               database or to print/display them directly. It's all up to you!

   Syntax:     XPdirTree(cDir,bTree[,cCross,cLine,cCorner,cSpace])

   Arguments:  cDir is the directory where to start the search,
               it defaults to \. bTree is the code block to invoke when
               a directory is entered.

               Every time, when the function traverses the tree,
               and enters a directory, bTree is invoked with
               two parameters: Graphical representation of the tree
               and the full name of the Path just entered.

               cCross, cLine, cCorner and cSpace define the shape of the
               graphical tree to produce, and default to the following:

               cCross := "|--"
               cLine  := "|  "
               cCorner:= "+--"
               cSpace := "   "

               you may use "|-","| ","+-","  ", for instance.

   Returns:    NIL

   Usage:      For example, Executing this on my system:
               XPdirTree('C:\DATA\XPLIB.920',{|g,f|Qout(g)})

               results in:
               C:\DATA\XPLIB.300\
               |--DOC
               |--NG
               |--PRG
               |  |--BAK
               |  +--TMP
               |--TMP
               +--UPD

               Whilst, executing:
               XPdirTree('C:\DATA\XPLIB.300',{|g,f|Qout(f)})

               results in:
               C:\DATA\XPLIB.300\
               C:\DATA\XPLIB.300\DOC\
               C:\DATA\XPLIB.300\NG\
               C:\DATA\XPLIB.300\PRG\
               C:\DATA\XPLIB.300\PRG\BAK\
               C:\DATA\XPLIB.300\PRG\TMP\
               C:\DATA\XPLIB.300\TMP\
               C:\DATA\XPLIB.300\UPD\

               Using the code-Block, one can fill an Array and do whatever is
               necessary.

See Also: XPfileFind()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson