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_OBJECT is the JSON object where Contains$ query is applied.
  • JSON_PATH is 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

See also

Parse Instance
Select$