home *** CD-ROM | disk | FTP | other *** search
- *******************
-
- FUNCTION Nosubdr
-
- PARAMETERS _drive
-
- PRIVATE _root, _dstring
-
- * _root = the root string format to search by
- * _dstring = the string for the drives
-
- _root = "\*."
- _dstring = "+\"
- _count = 1
-
- IF PCOUNT() = 0
- RETURN(0)
- ELSEIF LEN(_drive) != 2
- RETURN(0)
- ENDIF
-
- DO WHILE .T.
- _search = PARSING(@_dstring)
- IF EMPTY(_dstring)
- EXIT
- ENDIF
- _path = _drive + _search + _root
- DECLARE _temp[1]
- _temp[1] = ""
- _howmany = ADIR(_path, .F., .F., .F., .F., _temp)
- IF !EMPTY(_howmany)
- DECLARE _temp[_howmany], _names[_howmany]
- ADIR(_path, _names, .F., .F., .F., _temp)
- FOR x = 1 TO LEN(_temp)
- IF _temp[x] = "D"
- IF _names[x] = "." .OR. _names[x] = ".."
- ELSE
- _dstring = _dstring + _search + "\" + _names[x] + "+"
- _count = _count + 1
- ENDIF
- ENDIF
- NEXT
- ENDIF
- IF "\\"$_dstring
- _dstring = STRTRAN(_dstring, "\\", "\")
- ENDIF
- ENDDO
-
- RETURN(_count)
-
- * End of File