respAddObjectField()

This procedure adds JSON Object field into response.

ParameterTypeDescription
element30A VARYING, VARSIZEMandatoryName of element
fieldName30A VARYING, VARSIZEMandatoryField name
obj_ptrPOINTERMandatoryPointer to JSON Object

The procedure returns pointer of field. If procedure can’t add field, then returns null.

Note: The JSON Object have to be created by JSON_new(); procedure. Then use: JSON_startNode, JSON_endNode, JSON_addStringPair, JSON_addNumericPair, etc….. By these functions You can create JSON Object into memory. Then this JSON object can be put into response. After field is added then JSON_destroy must be used to avoid memory leak.`

Examples:

respAddObjectField('data': 'objectData': %ADDR(xxObjData));