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

  1. /*
  2.    Listing 18.14  Backdbf()
  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. function backdbf(cDbf_file,cDrive)
  12. LOCAL ndrv := asc(upper(cDrive))-64
  13. LOCAL oldfile :=trim(cDbf_file)+".DBF"
  14. LOCAL newfile :=cDrive+":\"+oldfile
  15. LOCAL tarr,num_recs
  16. if header()+(recsize()*lastrec()) > diskspace(ndrv)
  17.    go top
  18.    while !eof()
  19.       num_recs := ( diskspace(ndrv)-header() ) / recsize()
  20.       copy next num_recs to (newfile)
  21.       ? "Insert a new diskette in drive "+cDrive
  22.       inkey(500)
  23.    enddo
  24. else
  25.    copy file (oldfile) to (newfile)
  26. endif
  27. return NIL
  28.  
  29. // end of file CHP1814.PRG
  30.