(Tcl) Transition from Crypt2.LastJsonData to Crypt2.GetLastJsonData
Provides instructions for replacing deprecated LastJsonData method calls with GetLastJsonData. Note: This example requires Chilkat v11.0.0 or greater.
load ./chilkat.dll
set crypt2 [new_CkCrypt2]
# ...
# ...
# ------------------------------------------------------------------------
# The LastJsonData method is deprecated:
# jsonObj is a CkJsonObject
set jsonObj [CkCrypt2_LastJsonData $crypt2]
if {[CkCrypt2_get_LastMethodSuccess $crypt2] == 0} then {
puts [CkCrypt2_lastErrorText $crypt2]
delete_CkCrypt2 $crypt2
exit
}
# ...
# ...
delete_CkJsonObject $jsonObj
# ------------------------------------------------------------------------
# Do the equivalent using GetLastJsonData.
# Your application creates a new, empty JsonObject object which is passed
# in the last argument and filled upon success.
set jsonOut [new_CkJsonObject]
set success [CkCrypt2_GetLastJsonData $crypt2 $jsonOut]
if {$success == 0} then {
puts [CkCrypt2_lastErrorText $crypt2]
delete_CkCrypt2 $crypt2
delete_CkJsonObject $jsonOut
exit
}
delete_CkCrypt2 $crypt2
delete_CkJsonObject $jsonOut
|