home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pcmagazi / 1992 / 13 / compr.sc < prev    next >
Text File  |  1992-02-23  |  703b  |  26 lines

  1. ;  COMPR.SC - PAL script to compress current table and reclaim
  2. ;  disk space lost to deleted records.
  3.  
  4. ;  Make sure there is a current table
  5. IF NIMAGES() = 0 THEN
  6.     MESSAGE "No table to compress!"
  7.     BEEP SLEEP 5000
  8.     QUIT
  9. ENDIF
  10.  
  11. ;  Complete any pending operation and return to MAIN mode
  12. IF SYSMODE() <> "Main" THEN
  13.     DO_IT!
  14. ENDIF
  15.  
  16. ;  Save size of current table
  17. OldSize = FILESIZE(TABLE()+".DB")
  18.  
  19. ;  Restructure table with no changes to recover disk space
  20. MENU {Modify} {Restructure} SELECT TABLE() TYPEIN TABLE() {DO-IT!}
  21.  
  22. ;  Report on disk space saved by compression
  23. NewSize = FILESIZE(TABLE()+".DB")
  24. MESSAGE STRVAL(OldSize - NewSize) + " bytes saved!"
  25. BEEP SLEEP 5000
  26.