home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP20.EXE / CHP2003.PRG < prev    next >
Encoding:
Text File  |  1991-04-30  |  657 b   |  26 lines

  1. /*
  2.    Listing 20.3  Split()
  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 split(cFullname)
  14. LOCAL x := at(":", cFullname), y := Rat("\", cFullname)
  15. LOCAL the_drive:="", the_path:="", the_file:=""
  16. if x > 0
  17.    the_drive := substr(cFullname,1,x-1)
  18. endif
  19. if y > 0
  20.    the_path  := substr(cFullname,x+1,y-x)
  21.    the_file  := substr(cFullname,y+1)
  22. endif
  23. return NIL
  24.  
  25. // end of file CHP2003.PRG
  26.