Xbase++ Requires Chilkat v11.0.0+
Xbase++
Transition from Zip.AppendDataEncoded to Zip.AddEncoded
Provides instructions for replacing deprecated AppendDataEncoded method calls with AddEncoded.Chilkat Xbase++ Downloads
LOCAL nSuccess
LOCAL oZip
LOCAL cPathInZip
LOCAL cEncoding
LOCAL cEncData
LOCAL oEntryObj
LOCAL oZe
LOCAL nIndex
nSuccess := 0
oZip := CreateObject("Chilkat.Zip")
// ...
// ...
cPathInZip := "example.dat"
cEncoding := "base64"
cEncData := "... BASE64 DATA ..."
// ------------------------------------------------------------------------
// The AppendDataEncoded method is deprecated:
oEntryObj := oZip:AppendDataEncoded(cPathInZip, cEncoding, cEncData)
IF (oZip:LastMethodSuccess == 0)
? oZip:LastErrorText
oZip:destroy()
RETURN
ENDIF
// ...
// ...
oEntryObj:destroy()
// ------------------------------------------------------------------------
// Do the equivalent using AddEncoded.
// Instead of returning the zip entry object, we just return success/failure.
nSuccess := oZip:AddEncoded(cPathInZip, cEncoding, cEncData)
IF (nSuccess == 0)
? oZip:LastErrorText
oZip:destroy()
RETURN
ENDIF
// Do the following if you need the zip entry object for what was just appended.
// The newly appended entry is the last one.
oZe := CreateObject("Chilkat.ZipEntry")
nIndex := oZip:NumEntries - 1
oZip:EntryAt(nIndex, oZe)
oZip:destroy()
oZe:destroy()