Sample code for 30+ languages & platforms
DataFlex

Transition from Crypt2.LastJsonData to Crypt2.GetLastJsonData

Provides instructions for replacing deprecated LastJsonData method calls with GetLastJsonData.

Chilkat DataFlex Downloads

DataFlex
Use ChilkatAx-win32.pkg

Procedure Test
    Boolean iSuccess
    Handle hoCrypt2
    Variant vJsonObj
    Handle hoJsonObj
    Variant vJsonOut
    Handle hoJsonOut
    String sTemp1
    Boolean bTemp1

    Move False To iSuccess

    Get Create (RefClass(cComChilkatCrypt2)) To hoCrypt2
    If (Not(IsComObjectCreated(hoCrypt2))) Begin
        Send CreateComObject of hoCrypt2
    End

    // ...
    // ...

    // ------------------------------------------------------------------------
    // The LastJsonData method is deprecated:

    Get ComLastJsonData Of hoCrypt2 To vJsonObj
    If (IsComObject(vJsonObj)) Begin
        Get Create (RefClass(cComChilkatJsonObject)) To hoJsonObj
        Set pvComObject Of hoJsonObj To vJsonObj
    End
    Get ComLastMethodSuccess Of hoCrypt2 To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoCrypt2 To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    // ...
    // ...

    Send Destroy of hoJsonObj

    // ------------------------------------------------------------------------
    // Do the equivalent using GetLastJsonData.
    // Your application creates a new, empty JsonObject object which is passed 
    // in the last argument and filled upon success.

    Get Create (RefClass(cComChilkatJsonObject)) To hoJsonOut
    If (Not(IsComObjectCreated(hoJsonOut))) Begin
        Send CreateComObject of hoJsonOut
    End
    Get pvComObject of hoJsonOut to vJsonOut
    Send ComGetLastJsonData To hoCrypt2 vJsonOut
    If (iSuccess = False) Begin
        Get ComLastErrorText Of hoCrypt2 To sTemp1
        Showln sTemp1
        Procedure_Return
    End



End_Procedure