Contains$
Contains$ is used to check if a parsed JSON contains a given property.
Syntax
RETURN_VALUE = JSON_OBJECT.Contains$(JSON_POINTER)
RETURN_VALUEis an integer that contains the information returned by the Contains$ query.JSON_OBJECTis the JSON object where Contains$ query is applied.JSON_PATHis the JSON POINTER expression that contains the query to be checked if it exists in the JSON object.
Example
# Procedure to select a property
Local Clbfile SRCJSON
SRCJSON = '{"msg":"Hello World!"}'
# Create the object
Local Instance OBJ Using OBJECT
# Parse the object
ParseInstance OBJ With SRCJSON
# Check if the JSON contains a property
Local Integer R
R = OBJ.Contains$("/msg")
FreeGroup OBJ
Return values
| Value | Explanation |
|---|---|
| 0 | Operation succeeded. |
| -6 | The name of the variable does not exist in the JSON document. |
| -70 | Invalid argument type. |