home *** CD-ROM | disk | FTP | other *** search
- { --------------------------------------------------------------------
- | L I S T . P A S
- |
- | This is a Simple Pascal-Based Demonstration-Program for LZAPI
- |
- | It will show you the Listing of an Archiv
- | Bernd Herd 23.3.1995
- ---------------------------------------------------------------------- }
-
- Program Simple;
-
- uses LZAPI, WinProcs, WinTypes, Strings, WinCrt;
-
-
- var Ctl : LACTL; { Define the Control Strcture }
- ArchivName : Array[0..144] of char; { Windows-Directory with our INI-Files }
- This,
- Next : PChar;
- err : LAERR;
-
- Begin
- { ------ Ask User for the Filename ---------------- }
- WriteLn( 'L I S T . P A S ------------------- Demo-Program for LZAPI');
- WriteLn;
- Write ( 'Enter the Filename of the Archiv you''d like to be listet ? ');
- ReadLn (ArchivName);
-
- { ------ Fill Control structure ------------------- }
- FillChar( Ctl, sizeof(Ctl), 0);
- { Ctl.hwndOwner := ; This Program does not open a Window... normaly you MUST support this! }
- Ctl.lStructSize := sizeof( Ctl );
- Ctl.lpstrArchivFile := ArchivName;
- Ctl.Flags := LAF_SHORTNAMES;
- GetMem( Ctl.lpstrListing, 32767 );
-
- { ------ Perform Actions -------------------------- }
- err := LAList( @Ctl );
- if (err <> LAE_OK)
- then LAErrMsg(err, @Ctl )
- else Begin
- Next := Ctl.lpstrListing;
- while (Next<>NIL) do Begin
- This := Next;
- Next := strScan(This, #10);
- if (Next<>NIL) then Begin
- Next^:=#0;
- Inc(Next);
- End;
-
- writeLn(This);
- End;
-
- End;
-
- FreeMem( Ctl.lpstrListing, 32767 );
- End.
-