home *** CD-ROM | disk | FTP | other *** search
- Listing 6: ListDir
-
- 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