![]() |
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
(PowerBuilder) Transition from Zip.AppendBd to Zip.AddBdProvides instructions for replacing deprecated AppendBd method calls with AddBd. Note: This example requires Chilkat v11.0.0 or greater.
integer li_rc oleobject loo_Zip string ls_PathInZip oleobject loo_Bd oleobject loo_EntryObj integer li_Success oleobject loo_Ze integer li_Index loo_Zip = create oleobject // Use "Chilkat_9_5_0.Zip" for versions of Chilkat < 10.0.0 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 // ... // ... ls_PathInZip = "example.dat" loo_Bd = create oleobject // Use "Chilkat_9_5_0.BinData" for versions of Chilkat < 10.0.0 li_rc = loo_Bd.ConnectToNewObject("Chilkat.BinData") loo_Bd.LoadFile("c:/someDir/example.dat") // ------------------------------------------------------------------------ // The AppendBd method is deprecated: // AppendBd returns the zip entry object, which is usually not needed. loo_EntryObj = loo_Zip.AppendBd(ls_PathInZip,loo_Bd) if loo_Zip.LastMethodSuccess = 0 then Write-Debug loo_Zip.LastErrorText destroy loo_Zip destroy loo_Bd return end if // ... // ... destroy loo_EntryObj // ------------------------------------------------------------------------ // Do the equivalent using AddBd. // Instead of returning the zip entry object, we just return success/failure. li_Success = loo_Zip.AddBd(ls_PathInZip,loo_Bd) if li_Success = 0 then Write-Debug loo_Zip.LastErrorText destroy loo_Zip destroy loo_Bd return end if // Do the following if you need the zip entry object for what was just appended. // The newly appended entry is the last one. loo_Ze = create oleobject // Use "Chilkat_9_5_0.ZipEntry" for versions of Chilkat < 10.0.0 li_rc = loo_Ze.ConnectToNewObject("Chilkat.ZipEntry") li_Index = loo_Zip.NumEntries - 1 loo_Zip.EntryAt(li_Index,loo_Ze) destroy loo_Zip destroy loo_Bd destroy loo_Ze |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.