![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java JavaScript 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
(PowerBuilder) Find a ZIP Entry by EntryID Using EntryByIdSee more Zip Examples This example demonstrates how to use the Each This is useful when:
The example:
Note: This example requires Chilkat v11.0.0 or greater.
integer li_rc integer li_Success oleobject loo_Zip oleobject loo_Entry integer li_EntryId oleobject loo_Entry2 li_Success = 0 li_Success = 0 // Open an existing ZIP archive. loo_Zip = create oleobject li_rc = loo_Zip.ConnectToNewObject("Chilkat.Zip") if li_rc < 0 then destroy loo_Zip MessageBox("Error","Connecting to COM object failed") return end if li_Success = loo_Zip.OpenZip("example.zip") if li_Success = 0 then Write-Debug loo_Zip.LastErrorText destroy loo_Zip return end if // Retrieve the first entry in the ZIP archive. loo_Entry = create oleobject li_rc = loo_Entry.ConnectToNewObject("Chilkat.ZipEntry") li_Success = loo_Zip.EntryAt(0,loo_Entry) if li_Success = 0 then Write-Debug loo_Zip.LastErrorText destroy loo_Zip destroy loo_Entry return end if Write-Debug "Original entry:" Write-Debug " FileName: " + loo_Entry.FileName Write-Debug " EntryID: " + string(loo_Entry.EntryID) Write-Debug "" // Save the EntryID for later use. li_EntryId = loo_Entry.EntryID // Create another ZipEntry object. loo_Entry2 = create oleobject li_rc = loo_Entry2.ConnectToNewObject("Chilkat.ZipEntry") // Retrieve the same entry using EntryById. li_Success = loo_Zip.EntryById(li_EntryId,loo_Entry2) if li_Success = 0 then Write-Debug loo_Zip.LastErrorText destroy loo_Zip destroy loo_Entry destroy loo_Entry2 return end if Write-Debug "Entry retrieved by EntryID:" Write-Debug " FileName: " + loo_Entry2.FileName Write-Debug " EntryID: " + string(loo_Entry2.EntryID) Write-Debug "" // The filenames and EntryID values should match. loo_Zip.CloseZip() Write-Debug "Done." destroy loo_Zip destroy loo_Entry destroy loo_Entry2 |
||||
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.