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

  1. ********************
  2.  
  3. FUNCTION Whereis
  4.  
  5.    PARAMETER _thefile, _thedrive, _theabort
  6.  
  7.    * first, declare an array with the right number of elements for the
  8.    * subdrives.
  9.    * Next, fill the array with the subdrive names
  10.    * Finally, search each subdrive for _thefile and if found, store
  11.    * the name of the subdrive to a private variable called _retval
  12.    * If there are more than one subdrives with the file in it, then
  13.    * the string _retval will be a concatenated string with the "+"
  14.    * sign separating the subdrvive names.  This is so that the
  15.    * PARSING() function can work on it as well.
  16.  
  17.    PRIVATE _array, _retval, _x, _temp
  18.  
  19.    IF PCOUNT() <  2
  20.       RETURN("")
  21.    ELSEIF LEN(_thedrive) != 2
  22.       RETURN("")
  23.    ELSEIF TYPE("_thefile") + TYPE("_thedrive") != "CC"
  24.       RETURN("")
  25.    ELSEIF EMPTY(SUBSTR(_thedrive, 1, 1))
  26.       RETURN("")
  27.    ELSEIF EMPTY(_thefile)
  28.       RETURN("")
  29.    ENDIF
  30.  
  31.    IF PCOUNT() = 2
  32.       _theabort = .F.
  33.    ELSE
  34.       IF TYPE("_theabort") != "L"
  35.          RETURN("")
  36.       ENDIF
  37.    ENDIF
  38.  
  39.    _retval = ""
  40.    _temp   = ""
  41.    DECLARE _array[NOSUBDR(_thedrive)]
  42.    IF LEN(_array) != 0   && Otherwise, an error has occured
  43.       IF DRNAMES(_array, _thedrive, _theabort)
  44.          FOR _x = 1 TO LEN(_array)
  45.             _temp = STRTRAN(_thedrive + _array[_x] + "\" + _thefile, "\\", "\")
  46.             IF FILE(_temp)
  47.                _retval = _retval + STRTRAN(_thedrive + _array[_x] + "\" , "\\", "\") + "+"
  48.             ENDIF
  49.          NEXT
  50.       ENDIF
  51.    ENDIF
  52.    _array = ""
  53.    _temp = ""
  54.    RETURN(SUBSTR(_retval, 1, LEN(_retval)-1))
  55.          
  56.  
  57. * End of File
  58.