Sample code for 30+ languages & platforms
Visual FoxPro 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 Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loJson
LOCAL loFmt
LOCAL loJsonOut
LOCAL i
LOCAL n

lnSuccess = 0

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

loJson = CreateObject('Chilkat.JsonObject')
loFmt = CreateObject('Chilkat.Formats')
loJsonOut = CreateObject('Chilkat.JsonObject')
lnSuccess = loFmt.QrCode("capabilities",loJson,loJsonOut)
IF (lnSuccess = 0) THEN
    ? loFmt.LastErrorText
    RELEASE loJson
    RELEASE loFmt
    RELEASE loJsonOut
    CANCEL
ENDIF

? "Chilkat version: " + loJsonOut.StringOf("productVersion")
? "symbology: " + loJsonOut.StringOf("symbologies[0].id")
? "QR versions: " + STR(loJsonOut.IntOf("symbologies[0].encoding.version.min")) + " to " + STR(loJsonOut.IntOf("symbologies[0].encoding.version.max"))
? "structured append, most symbols: " + STR(loJsonOut.IntOf("symbologies[0].structuredAppend.maxSymbols"))

n = loJsonOut.SizeOfArray("symbologies[0].encoding.errorCorrection")
FOR i = 0 TO n - 1
    loJsonOut.I = i
    ? "error correction: " + loJsonOut.StringOf("symbologies[0].encoding.errorCorrection[i]")
NEXT

*  The operations this version implements.
n = loJsonOut.SizeOfArray("operations")
FOR i = 0 TO n - 1
    loJsonOut.I = i
    IF (loJsonOut.BoolOf("operations[i].available") = 1) THEN
        ? "operation: " + loJsonOut.StringOf("operations[i].name")
    ENDIF

NEXT

n = loJsonOut.SizeOfArray("imageFormats.output")
FOR i = 0 TO n - 1
    loJsonOut.I = i
    ? "image format: " + loJsonOut.StringOf("imageFormats.output[i]")
NEXT

? "default timeout: " + STR(loJsonOut.IntOf("limits.timeoutMs.default")) + " ms"
? "default largest image: " + STR(loJsonOut.IntOf("limits.maxPixels.default")) + " 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

RELEASE loJson
RELEASE loFmt
RELEASE loJsonOut