Null Method (JSONDATA)
10.8, PLBCMP GUI Only
The Null method sets a JSON field in a JSONDATA object to have a 'null' value for the JSON key with the specified name. 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 (0) or fail (!0) value.
name
Required. A Character String Variable or literal that specifies a JSON field name for a JSONDATA object.
index1
Optional. A Numeric Variable, decimal number, or Numeric expression that defines the first index of a JSON array that is being accessed.
index2
Optional. A Numeric Variable, decimal number, or Numeric expression that defines the second index of a JSON multi-dimensioned array that is being accessed.
index3
Optional. A Numeric Variable, decimal number, or Numeric expression that defines the third index of a JSON multi-dimensioned array that is being accessed.
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.
At runtime, the tokens $1, $2, and $3 that appear in the {name} parameter are replaced with the numeric values of the corresponding {index1}, {index2}, or {index3} parameters.
The error values returned in {return} are defined as follows
|
Error |
Description |
|
1 |
Memory allocation error. |
|
2 |
JSON parse error. Check SyntaxError method! |
|
5 |
JSON error type mismatch. |
|
7 |
JSON method input is null or invalid. |
If an error occurs, the JSONDATA object method 'SyntaxError' canbe used to retrieve that last error that was generated.
The resulting output JSON field for the JSON key is to have a value defined as 'null'. This JSON field simply indicates that the JSON value is intentionally absent of any data.
Example of JSON field with 'null' value:
"MyName" : null
See Also: Method Syntax, JSONDATA Methods
![]() |