home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 18.14 Backdbf()
- Author: Joe Booth
- Excerpted from "Clipper 5: A Developer's Guide"
- Copyright (c) 1991 M&T Books
- 501 Galveston Drive
- Redwood City, CA 94063-4728
- (415) 366-3600
- */
-
- function backdbf(cDbf_file,cDrive)
- LOCAL ndrv := asc(upper(cDrive))-64
- LOCAL oldfile :=trim(cDbf_file)+".DBF"
- LOCAL newfile :=cDrive+":\"+oldfile
- LOCAL tarr,num_recs
- if header()+(recsize()*lastrec()) > diskspace(ndrv)
- go top
- while !eof()
- num_recs := ( diskspace(ndrv)-header() ) / recsize()
- copy next num_recs to (newfile)
- ? "Insert a new diskette in drive "+cDrive
- inkey(500)
- enddo
- else
- copy file (oldfile) to (newfile)
- endif
- return NIL
-
- // end of file CHP1814.PRG
-