home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MAGAZINE / MISC / DBMS9103.ZIP / YELLICK2.MAR < prev    next >
Encoding:
Text File  |  1991-02-04  |  490 b   |  21 lines

  1. Listing 6: ListDir
  2.  
  3. function ListDir(dir_, level)
  4.     /* List the contents of an array containing a directory
  5.      structure. This function uses a recursive call to itself.*/
  6.  
  7.     local i
  8.        if level = nil
  9.          level := 0
  10.        endif
  11.        for i := 1 to len(dir_)
  12.          ? space(level *3)
  13.          if valtype(dir_[i]) = "A"
  14.          ?? dir_[i, 1]
  15.            ListDir(dir_[i, 2], level +1)
  16.          else
  17.            ?? dir_[i]
  18.          endif
  19.        next i
  20.      return nil
  21.