Sample code for 30+ languages & platforms
PureBasic

Transition from Zip.AppendSb to Zip.AddSb

Provides instructions for replacing deprecated AppendSb method calls with AddSb.

Chilkat PureBasic Downloads

PureBasic
IncludeFile "CkZip.pb"
IncludeFile "CkStringBuilder.pb"

Procedure ChilkatExample()

    success.i = 0

    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 = 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