home *** CD-ROM | disk | FTP | other *** search
/ Computer Installation Guide - Dragon Clan Series / CD2.iso / ZIP / WWPACK / WWP304 / PASCAL / DEMO_1.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-01-05  |  1.6 KB  |  46 lines

  1. {  DEMO_1.PAS   Copyright (c) 1995-96 by Piotr Warezak and Rafal Wierzbicki
  2.  
  3.    This program demonstrates how to use WWP_CRC unit and check_if_packed
  4.    function.
  5.  
  6.    Please compile this program to the disk and then follow it's advices.
  7.  
  8.    ========================================================================
  9.  
  10.    This program is public domain and may be freely distributed.
  11.  
  12.    ========================================================================   }
  13.  
  14. program demo1;
  15. uses wwp_crc;                                                   {use WWP_CRC unit}
  16. var f:file;
  17.  
  18. {$I CHK_WWP.PAS}                                                {use CHECK_IF_PACKED function}
  19.  
  20. begin
  21.   writeln;
  22.   assign(f,paramstr(0));reset(f,1);                             {open file}
  23.   if (check_if_packed(f)<9) or (check_if_packed(f)=14) or
  24.      (check_if_packed(f)=17) or (check_if_packed(f)=21) then    {check if packed with P/PP or PU}
  25.   begin
  26.     writeln(':-(   I''m not packed with P/PP/PU!');
  27.     writeln(':-(   Why don''t you pack me with  WWPACK P  command?');
  28.     writeln(':-(   I''ll be much smaller!');
  29.     halt;
  30.   end;
  31.   if check_crc(f)=1 then                                        {check if damaged}
  32.   begin
  33.     writeln(':-(   I''m damaged!');
  34.     writeln(':-(   Please compile me again!');
  35.     halt;
  36.   end;
  37.   if check_crc(f)>1 then
  38.   begin
  39.     writeln(':-(   Something is wrong with me!');
  40.     writeln(':-(   Please compile me again!');
  41.     halt;
  42.   end;
  43.   writeln(':-)  I''m so happy!');                               {YES! That's it!}
  44.   writeln(':-)  To be packed with WWPACK...');
  45.   writeln(':-)  There is nothing as beautiful like that!');
  46. end.