(PowerBuilder) Replace Deprecated GetExpirationDt
Shows how to replace the deprecated GetExpirationDt method.
integer li_rc
oleobject loo_Cache
string ls_Cache_item_key
oleobject loo_Dt1
oleobject loo_Dt2
loo_Cache = create oleobject
// Use "Chilkat_9_5_0.Cache" for versions of Chilkat < 10.0.0
li_rc = loo_Cache.ConnectToNewObject("Chilkat.Cache")
if li_rc < 0 then
destroy loo_Cache
MessageBox("Error","Connecting to COM object failed")
return
end if
// ....
// ....
ls_Cache_item_key = "xyz"
// Instead of this:
loo_Dt1 = loo_Cache.GetExpirationDt(ls_Cache_item_key)
destroy loo_Dt1
// Do this:
loo_Dt2 = create oleobject
// Use "Chilkat_9_5_0.CkDateTime" for versions of Chilkat < 10.0.0
li_rc = loo_Dt2.ConnectToNewObject("Chilkat.CkDateTime")
loo_Dt2.SetFromRfc822(loo_Cache.GetExpirationStr(ls_Cache_item_key))
destroy loo_Cache
destroy loo_Dt2
|