Select$
Select$ is used to select properties in a parsed JSON.
Syntax
RETURN_VALUE = JSON_OBJECT.Select$(JSON_PATH)
RETURN_VALUEis a string that contains the information returned by the Select$ query.JSON_OBJECTis a string variable that contains the path to the file you want to rename.JSON_PATHis the JSON PATH expression that contains the query to be selected from 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
# Select the property
Local Char MYSTR(30)
MYSTR = OBJ.Select$("$.msg")
FreeGroup OBJ
Return values
| Value | Explanation |
|---|---|
| 0 | Operation succeeded. |
| -6 | The name of the variable does not exist in the JSON document. |
| -26 | Invalid JSON document. |
| -70 | Invalid argument type. |
Notes
The syntax for JSON_PATH is based on the XML XPath design.