![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Delphi ActiveX) Transition from ZipEntry.NextEntry to ZipEntry.GetNextProvides instructions for replacing deprecated NextEntry method calls with GetNext. Note: This example requires Chilkat v11.0.0 or greater.
uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB; ... procedure TForm1.Button1Click(Sender: TObject); var zip: TChilkatZip; success: Integer; entry: IChilkatZipEntry; finished: Integer; next: IChilkatZipEntry; ze: TChilkatZipEntry; entryValid: Integer; begin // ------------------------------------------------------------------------ // The NextEntry method is deprecated. // See below or code showing how to rewrite using EntryAt/GetNext zip := TChilkatZip.Create(Self); success := zip.OpenZip('qa_data/zips/xml_files.zip'); if (success <> 1) then begin Memo1.Lines.Add(zip.LastErrorText); Exit; end; entry := zip.FirstEntry(); if (zip.LastMethodSuccess = 0) then begin Memo1.Lines.Add('This zip archive is empty.'); Exit; end; finished := 0; while finished = 0 do begin if (entry.IsDirectory = 0) then begin Memo1.Lines.Add(entry.FileName); end else begin Memo1.Lines.Add('(directory) ' + entry.FileName); end; next := entry.NextEntry(); if (entry.LastMethodSuccess = 0) then begin finished := 1; end; entry := next; end; zip.CloseZip(); Memo1.Lines.Add('----'); // ------------------------------------------------------------------------ // Do the equivalent using EntryAt/GetNext. success := zip.OpenZip('qa_data/zips/xml_files.zip'); ze := TChilkatZipEntry.Create(Self); zip.EntryAt(0,ze.ControlInterface); entryValid := 1; while entryValid = 1 do begin if (ze.IsDirectory = 0) then begin Memo1.Lines.Add(ze.FileName); end else begin Memo1.Lines.Add('(directory) ' + ze.FileName); end; entryValid := ze.GetNext(); end; zip.CloseZip(); end; |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.