home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Whereis
-
- PARAMETER _thefile, _thedrive, _theabort
-
- * first, declare an array with the right number of elements for the
- * subdrives.
- * Next, fill the array with the subdrive names
- * Finally, search each subdrive for _thefile and if found, store
- * the name of the subdrive to a private variable called _retval
- * If there are more than one subdrives with the file in it, then
- * the string _retval will be a concatenated string with the "+"
- * sign separating the subdrvive names. This is so that the
- * PARSING() function can work on it as well.
-
- PRIVATE _array, _retval, _x, _temp
-
- IF PCOUNT() < 2
- RETURN("")
- ELSEIF LEN(_thedrive) != 2
- RETURN("")
- ELSEIF TYPE("_thefile") + TYPE("_thedrive") != "CC"
- RETURN("")
- ELSEIF EMPTY(SUBSTR(_thedrive, 1, 1))
- RETURN("")
- ELSEIF EMPTY(_thefile)
- RETURN("")
- ENDIF
-
- IF PCOUNT() = 2
- _theabort = .F.
- ELSE
- IF TYPE("_theabort") != "L"
- RETURN("")
- ENDIF
- ENDIF
-
- _retval = ""
- _temp = ""
- DECLARE _array[NOSUBDR(_thedrive)]
- IF LEN(_array) != 0 && Otherwise, an error has occured
- IF DRNAMES(_array, _thedrive, _theabort)
- FOR _x = 1 TO LEN(_array)
- _temp = STRTRAN(_thedrive + _array[_x] + "\" + _thefile, "\\", "\")
- IF FILE(_temp)
- _retval = _retval + STRTRAN(_thedrive + _array[_x] + "\" , "\\", "\") + "+"
- ENDIF
- NEXT
- ENDIF
- ENDIF
- _array = ""
- _temp = ""
- RETURN(SUBSTR(_retval, 1, LEN(_retval)-1))
-
-
- * End of File