Sample code for 30+ languages & platforms
Tcl

Transition from Crypt2.LastJsonData to Crypt2.GetLastJsonData

Provides instructions for replacing deprecated LastJsonData method calls with GetLastJsonData.

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set success 0

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]

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