SyntaxError Method (JSONDATA)
10.8, PLBCMP GUI Only
The SyntaxError method is used to retrieve and return the last error that has been logged for the JSON object. This method uses the following format:
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A JSONDATA object previously declared.
return
Optional. A Character Variable that returns the last error logged for the JSON object.
Flags Affected: EOS, OVER, ZERO
Notes:
The EOS flag is set if the output error string is truncatedbecause the {return} variable is too small.
The ZERO and OVER flags are always cleared.
If an error occurs that is logged, the JSON object 'SyntaxError' method is used to retrieve the error number and position. This message returns the logged error in the following format
"Syntax error X at position Y"
Where:
'X' is the decimal number assigned to the logged error.
'Y' is the decimal position of the error in the JSON string.
The possible 'X' errors are defined as follows:
|
Error Code |
Description |
|
1 |
JSON syntax missing indent. |
|
2 |
JSON syntax unexpected character. |
|
3 |
JSON error syntax no node. |
|
4 |
JSON array syntax expected. |
|
5 |
JSON object syntax expected. |
|
6 |
JSON error syntax unknown name. |
|
7 |
JSON syntax array index error. |
|
8 |
Invalid array index $ identifier. |
|
9 |
Unknown array index identifier. |
|
10 |
Unexpected array index character. |
|
11 |
JSON Root not found! . |
See Also: Method Syntax, JSONDATA Methods
![]() |