home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a075 / 1.img / TOOLKIT1.EXE / SST240.PRG < prev    next >
Encoding:
Text File  |  1989-08-08  |  1.2 KB  |  52 lines

  1. *******************
  2.  
  3. FUNCTION Nosubdr
  4.  
  5.    PARAMETERS _drive
  6.  
  7.    PRIVATE _root, _dstring
  8.  
  9.    * _root = the root string format to search by
  10.    * _dstring = the string for the drives
  11.  
  12.    _root = "\*."
  13.    _dstring = "+\"
  14.    _count =  1
  15.  
  16.    IF PCOUNT() = 0
  17.       RETURN(0)
  18.    ELSEIF LEN(_drive) != 2
  19.       RETURN(0)
  20.    ENDIF
  21.  
  22.    DO WHILE .T.
  23.       _search = PARSING(@_dstring) 
  24.       IF EMPTY(_dstring)
  25.          EXIT
  26.       ENDIF
  27.       _path = _drive + _search + _root
  28.       DECLARE _temp[1]
  29.       _temp[1] = ""
  30.       _howmany = ADIR(_path, .F., .F., .F., .F., _temp)
  31.       IF !EMPTY(_howmany)
  32.          DECLARE _temp[_howmany], _names[_howmany]
  33.          ADIR(_path, _names, .F., .F., .F., _temp)
  34.          FOR x = 1 TO LEN(_temp)
  35.             IF _temp[x] = "D"
  36.                IF _names[x] = "." .OR. _names[x] = ".."
  37.                ELSE
  38.                   _dstring = _dstring + _search + "\" + _names[x] + "+"
  39.                   _count = _count + 1
  40.                ENDIF
  41.             ENDIF
  42.          NEXT
  43.       ENDIF
  44.       IF "\\"$_dstring
  45.          _dstring = STRTRAN(_dstring, "\\", "\")
  46.       ENDIF
  47.    ENDDO
  48.  
  49.    RETURN(_count)
  50.  
  51. * End of File
  52.