home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP22.EXE / CHP2207.PRG < prev   
Encoding:
Text File  |  1991-04-30  |  649 b   |  29 lines

  1. /*
  2.    Listing 22.7  Inpath()
  3.    Author: Joe Booth
  4.    Excerpted from "Clipper 5: A Developer's Guide"
  5.    Copyright (c) 1991 M&T Books
  6.                       501 Galveston Drive
  7.                       Redwood City, CA 94063-4728
  8.                       (415) 366-3600
  9. */
  10.  
  11. //───── NOTE: must compile with the /N option!
  12.  
  13. function inpath(mfile)
  14. LOCAL pathlist,jj,tfile
  15. if ! file(mfile)
  16.    pathlist := PARSE( getenv("PATH"),";" )
  17.    for jj = 1 to len(pathlist)
  18.       tfile := pathlist[jj]+"\"+trim(mfile)
  19.       if file(tfile)
  20.          return .T.
  21.       endif
  22.    next
  23. else
  24.    return .T.
  25. endif
  26. return .F.
  27.  
  28. // end of file CHP2207.PRG
  29.