home *** CD-ROM | disk | FTP | other *** search
- { DEMO_1.PAS Copyright (c) 1995-96 by Piotr Warezak and Rafal Wierzbicki
-
- This program demonstrates how to use WWP_CRC unit and check_if_packed
- function.
-
- Please compile this program to the disk and then follow it's advices.
-
- ========================================================================
-
- This program is public domain and may be freely distributed.
-
- ======================================================================== }
-
- program demo1;
- uses wwp_crc; {use WWP_CRC unit}
- var f:file;
-
- {$I CHK_WWP.PAS} {use CHECK_IF_PACKED function}
-
- begin
- writeln;
- assign(f,paramstr(0));reset(f,1); {open file}
- if (check_if_packed(f)<9) or (check_if_packed(f)=14) or
- (check_if_packed(f)=17) or (check_if_packed(f)=21) then {check if packed with P/PP or PU}
- begin
- writeln(':-( I''m not packed with P/PP/PU!');
- writeln(':-( Why don''t you pack me with WWPACK P command?');
- writeln(':-( I''ll be much smaller!');
- halt;
- end;
- if check_crc(f)=1 then {check if damaged}
- begin
- writeln(':-( I''m damaged!');
- writeln(':-( Please compile me again!');
- halt;
- end;
- if check_crc(f)>1 then
- begin
- writeln(':-( Something is wrong with me!');
- writeln(':-( Please compile me again!');
- halt;
- end;
- writeln(':-) I''m so happy!'); {YES! That's it!}
- writeln(':-) To be packed with WWPACK...');
- writeln(':-) There is nothing as beautiful like that!');
- end.