home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / SASC6571.LZX / extras / ttx / rexx / ttx_sasc / GetFilePart < prev    next >
Encoding:
Text File  |  1996-12-24  |  307 b   |  18 lines

  1. /*
  2. **   GetFilePart: Extracts the file name from a full file specification.
  3. ** So long as that spec is valid, this should not fail.
  4. */
  5.  
  6. GetFilePart:
  7.  
  8. Parse ARG path
  9.  
  10. dirend = LastPos('/', path)
  11. if dirend = 0 then
  12.     dirend = Pos(':',path)
  13. if dirend ~= 0 then
  14.     file = SubStr(path,dirend+1)
  15.  
  16. Return file
  17.  
  18.