home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / ECO30603.ZIP / ECO30603.LZH / ECOLIBII / DEMOS / DEMO_LZW.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-08-02  |  784 b   |  38 lines

  1. program lzwtest;
  2.  
  3. { author: gary conway and blake ragsdell          }
  4. { this program compresses and uncompresses a file }
  5. { using lzw compression.                          }
  6.  
  7. uses
  8.   crt, dos,
  9.   eco_lzw
  10.  
  11.   ;
  12.  
  13. var
  14.   lzw       : lzwobj;
  15.   inputfile : pathstr;
  16.  
  17. begin
  18.   clrscr;
  19.   inputfile := paramstr(1);
  20.   if length(inputfile) = 0 then begin
  21.     writeln('Please include a filename on the command line.');
  22.     halt
  23.   end;
  24.   writeln('Compressing ',inputfile,' into OUTPUT.PAS');
  25.   with lzw do begin
  26.     init;
  27.     compressfile(inputfile,'OUTPUT.PAS');
  28.     compressdone;
  29.     clrscr;
  30.     writeln('UnCompressing OUTPUT.PAS into RESTORED.PAS');
  31.     init;
  32.     uncompressfile('Output.PAS','Restored.PAS');
  33.     compressdone
  34.   end;
  35. end.
  36.  
  37. {--- gecho 1.00/beta}
  38.