Sample code for 30+ languages & platforms
PureBasic

Replace Deprecated GetExpirationDt

Shows how to replace the deprecated GetExpirationDt method.

Chilkat PureBasic Downloads

PureBasic
IncludeFile "CkDateTime.pb"
IncludeFile "CkCache.pb"

Procedure ChilkatExample()

    cache.i = CkCache::ckCreate()
    If cache.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    ; ....
    ; ....

    cache_item_key.s = "xyz"

    ; Instead of this:
    dt1.i = CkCache::ckGetExpirationDt(cache,cache_item_key)
    CkDateTime::ckDispose(dt1)

    ; Do this:
    dt2.i = CkDateTime::ckCreate()
    If dt2.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    CkDateTime::ckSetFromRfc822(dt2,CkCache::ckGetExpirationStr(cache,cache_item_key))


    CkCache::ckDispose(cache)
    CkDateTime::ckDispose(dt2)


    ProcedureReturn
EndProcedure