Sample code for 30+ languages & platforms
DataFlex Requires Chilkat v11.7.0+

Get the QR Code Capabilities of the Chilkat Version in Use

See more QR Code Examples

Demonstrates the capabilities operation, which describes what the installed version of Chilkat can do: the range of QR versions, the error-correction levels, the operations, the image formats and the limits. A program can check for a feature here instead of testing for a Chilkat version number. The request can be an empty JSON object.

Chilkat DataFlex Downloads

DataFlex
Use ChilkatAx-win32.pkg

Procedure Test
    Boolean iSuccess
    Variant vJson
    Handle hoJson
    Handle hoFmt
    Variant vJsonOut
    Handle hoJsonOut
    Integer i
    Integer n
    String sTemp1
    Integer iTemp1
    Integer iTemp2
    Boolean bTemp1

    Move False To iSuccess

    //  This example requires the Chilkat API to have been previously unlocked.
    //  See Global Unlock Sample for sample code.

    Get Create (RefClass(cComChilkatJsonObject)) To hoJson
    If (Not(IsComObjectCreated(hoJson))) Begin
        Send CreateComObject of hoJson
    End
    Get Create (RefClass(cComChilkatFormats)) To hoFmt
    If (Not(IsComObjectCreated(hoFmt))) Begin
        Send CreateComObject of hoFmt
    End
    Get Create (RefClass(cComChilkatJsonObject)) To hoJsonOut
    If (Not(IsComObjectCreated(hoJsonOut))) Begin
        Send CreateComObject of hoJsonOut
    End
    Get pvComObject of hoJson to vJson
    Get pvComObject of hoJsonOut to vJsonOut
    Get ComQrCode Of hoFmt "capabilities" vJson vJsonOut To iSuccess
    If (iSuccess = False) Begin
        Get ComLastErrorText Of hoFmt To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComStringOf Of hoJsonOut "productVersion" To sTemp1
    Showln "Chilkat version: " sTemp1
    Get ComStringOf Of hoJsonOut "symbologies[0].id" To sTemp1
    Showln "symbology: " sTemp1
    Get ComIntOf Of hoJsonOut "symbologies[0].encoding.version.min" To iTemp1
    Get ComIntOf Of hoJsonOut "symbologies[0].encoding.version.max" To iTemp2
    Showln "QR versions: " iTemp1 " to " iTemp2
    Get ComIntOf Of hoJsonOut "symbologies[0].structuredAppend.maxSymbols" To iTemp1
    Showln "structured append, most symbols: " iTemp1

    Get ComSizeOfArray Of hoJsonOut "symbologies[0].encoding.errorCorrection" To n
    For i From 0 To (n - 1)
        Set ComI Of hoJsonOut To i
        Get ComStringOf Of hoJsonOut "symbologies[0].encoding.errorCorrection[i]" To sTemp1
        Showln "error correction: " sTemp1
    Loop

    //  The operations this version implements.
    Get ComSizeOfArray Of hoJsonOut "operations" To n
    For i From 0 To (n - 1)
        Set ComI Of hoJsonOut To i
        Get ComBoolOf Of hoJsonOut "operations[i].available" To bTemp1
        If (bTemp1 = True) Begin
            Get ComStringOf Of hoJsonOut "operations[i].name" To sTemp1
            Showln "operation: " sTemp1
        End

    Loop

    Get ComSizeOfArray Of hoJsonOut "imageFormats.output" To n
    For i From 0 To (n - 1)
        Set ComI Of hoJsonOut To i
        Get ComStringOf Of hoJsonOut "imageFormats.output[i]" To sTemp1
        Showln "image format: " sTemp1
    Loop

    Get ComIntOf Of hoJsonOut "limits.timeoutMs.default" To iTemp1
    Showln "default timeout: " iTemp1 " ms"
    Get ComIntOf Of hoJsonOut "limits.maxPixels.default" To iTemp1
    Showln "default largest image: " iTemp1 " pixels"

    //  Sample output:

    //  Chilkat version: 11.7.0
    //  symbology: qr
    //  QR versions: 1 to 40
    //  structured append, most symbols: 16
    //  error correction: auto
    //  error correction: L
    //  error correction: M
    //  error correction: Q
    //  error correction: H
    //  operation: generate
    //  operation: measure
    //  operation: validate
    //  operation: capabilities
    //  image format: png
    //  image format: svg
    //  default timeout: 10000 ms
    //  default largest image: 16777216 pixels


End_Procedure