(PureBasic) Transition from Zip.AppendSb to Zip.AddSb
Provides instructions for replacing deprecated AppendSb method calls with AddSb. Note: This example requires Chilkat v11.0.0 or greater.
IncludeFile "CkZip.pb"
IncludeFile "CkStringBuilder.pb"
Procedure ChilkatExample()
zip.i = CkZip::ckCreate()
If zip.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
; ...
; ...
pathInZip.s = "example.txt"
sb.i = CkStringBuilder::ckCreate()
If sb.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkStringBuilder::ckAppend(sb,"This is a test")
charset.s = "utf-8"
; ------------------------------------------------------------------------
; The AppendSb method is deprecated:
success.i = CkZip::ckAppendSb(zip,pathInZip,sb,charset)
; ------------------------------------------------------------------------
; For consistency, the name has changed to AddSb.
success = CkZip::ckAddSb(zip,pathInZip,sb,charset)
CkZip::ckDispose(zip)
CkStringBuilder::ckDispose(sb)
ProcedureReturn
EndProcedure
|