home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 9.7. A function which lists an array with variable structure.
- Author: Craig Yellick
- Excerpted from "Clipper 5: A Developer's Guide"
- Copyright (c) 1991 M&T Books
- 501 Galveston Drive
- Redwood City, CA 94063-4728
- (415) 366-3600
- */
-
- function ListDir(dir_, level)
- /*
- List the contents of an array containing a
- directory structure. This function uses a
- recursive call to itself.
- */
- local i
- if level = nil
- level := 0
- endif
- for i := 1 to len(dir_)
- ? space(level *3)
- if valtype(dir_[i]) = "A"
- ?? dir_[i, 1]
- ListDir(dir_[i, 2], level +1)
- else
- ?? dir_[i]
- endif
- next i
- return nil
-
- // end of file CHP0907.PRG
-