home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / WINDOWS / LZAPI.ZIP / SIMPLE.ZIP / LIST.PAS next >
Encoding:
Pascal/Delphi Source File  |  1995-05-08  |  1.7 KB  |  57 lines

  1. { --------------------------------------------------------------------
  2.  |        L I S T . P A S
  3.  |
  4.  | This is a Simple Pascal-Based Demonstration-Program for LZAPI
  5.  |
  6.  | It will show you the Listing of an Archiv
  7.  | Bernd Herd 23.3.1995
  8.  ---------------------------------------------------------------------- }
  9.  
  10. Program Simple;
  11.  
  12. uses LZAPI, WinProcs, WinTypes, Strings, WinCrt;
  13.  
  14.  
  15. var Ctl              : LACTL;                   { Define the Control Strcture }
  16.     ArchivName       : Array[0..144] of char;   { Windows-Directory with our INI-Files }
  17.     This,
  18.     Next             : PChar;
  19.     err              : LAERR;
  20.  
  21. Begin
  22.   { ------ Ask User for the Filename ---------------- }
  23.   WriteLn( 'L I S T . P A S ------------------- Demo-Program for LZAPI');
  24.   WriteLn;
  25.   Write  ( 'Enter the Filename of the Archiv you''d like to be listet ? ');
  26.   ReadLn (ArchivName);
  27.  
  28.   { ------ Fill Control structure ------------------- }
  29.   FillChar( Ctl, sizeof(Ctl), 0);
  30. {  Ctl.hwndOwner       := ; This Program does not open a Window... normaly you MUST support this! }
  31.   Ctl.lStructSize     := sizeof( Ctl );
  32.   Ctl.lpstrArchivFile := ArchivName;
  33.   Ctl.Flags           := LAF_SHORTNAMES;
  34.   GetMem( Ctl.lpstrListing, 32767 );
  35.  
  36.   { ------ Perform Actions -------------------------- }
  37.   err := LAList( @Ctl );
  38.   if (err <> LAE_OK)
  39.       then LAErrMsg(err, @Ctl )
  40.       else Begin
  41.            Next := Ctl.lpstrListing;
  42.            while (Next<>NIL) do Begin
  43.               This := Next;
  44.               Next := strScan(This, #10);
  45.               if (Next<>NIL) then Begin
  46.                  Next^:=#0;
  47.                  Inc(Next);
  48.               End;
  49.  
  50.               writeLn(This);
  51.            End;
  52.  
  53.       End;
  54.  
  55.   FreeMem( Ctl.lpstrListing, 32767 );
  56. End.
  57.