PARSE Method (JSONDATA)
10.8, PLBCMP GUI Only
The Parse method is used to make nodes in the JSONDATA object from a valid JSON string. This method verifies and validates the JSON string syntax. This method uses the following format:
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A JSONDATA object previously declared.
return
Optional. A Numeric Variable that returns a pass (zero) or fail (non-zero) value.
json
Required. A Character String Variable or literal that contains a valid JSON object stream.
options
Optional. A Numeric Variable, decimal number, or Numeric expression that defines a bit mask value that is used to control the behaviors of this method.
Flags Affected: EOS, OVER, ZERO
Notes:
The EOS flag is always cleared.
The ZERO flag is set if the return value is zero. Otherwise, the ZERO flag is cleared for non-zero values.
The OVER flag is set if the return value must be truncated.
The {options} bit mask values are defined as follows:
|
Option |
Value |
Meaning |
|
$JSF_PARSE_ALLOW_COMMENTS |
0x01 |
Allow comments in the JSON input data. |
When this method generates an error, the {return} variable contains the error codes:
|
Error |
Description |
|
1 |
Memory allocation error. |
|
2 |
JSON parse error. Check SyntaxError method! |
|
3 |
JSON unknown type. |
|
10nn |
Filter expression error. |
|
1199 |
Invalid JSON stream. |
If an error occurs, the JSONDATA object method 'SyntaxError' can be used to retrieve that last error that was generated.
See Also: Method Syntax, JSONDATA Methods
![]() |