home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol10n21.zip / DEL.PRG < prev    next >
Text File  |  1991-07-03  |  850b  |  21 lines

  1. ***********************************************************************
  2. * DEL.PRG                                                FoxPro 2.0
  3. * Delete all files specified by a wildcard expression.
  4. *
  5. * Example: DO DEL WITH "c:\*.bak"
  6. ***********************************************************************
  7. PROCEDURE DEL
  8. PARAMETERS mWild
  9. PRIVATE mPath, mFile
  10.  
  11.   mWild = FULLPATH(mWild)                 && Construct full path
  12.  
  13.   mPath = LEFT( mWild, RAT("\",mWild) )   && Extract path
  14.   mFile = SYS( 2000, mWild )              && Find first matching file.
  15.   DO WHILE ! EMPTY( mFile )               && Was a matching file found?
  16.      ERASE ( mPath+mFile )                &&    Yes, delete it.
  17.      mFile = SYS( 2000, mWild, 1)         &&    Find next matching file.
  18.   ENDDO                                   && Repeat process.
  19.  
  20. RETURN
  21.