LoadJson Method (XDATA)
9.8A
The LoadJson method loads JSON data into a XDATA object. The input data can be loaded directly from a DIM variable or from a specified file that contains a valid JSON stream. The new JSON data replaces all currently existing data in the XDATA object. The method uses the following format:
|
|
|
|
Where:
Flags Affected: EOS, OVER, ZERO
Note the following:
The ZERO flag is set if the {return} value is zero.
The OVER flag is set TRUE if the {return} variable is too small where the returned value is truncated.
The EOS flag is always cleared.
The *OPTIONS {mask} values are defined as follows:
|
Value |
This bit value ... |
|
0x1 |
indicates that the {data} method parameter contains a path and file name which contains the JSON data to be loaded. |
|
0x2 |
causes the JSON data file to be opened in read only mode. |
|
0x4 |
allows JavaScript style comments in the JSON data being loaded. |
The {return} value is a zero if the method execution is successful. Otherwise, a non-zero value is returned to indicate an error has occurred. See the XDATA Method Return Values for more details.
This method can return these values:
|
Value |
Meaning |
|
0 |
XDATA_ERR_NONE (Success) |
|
1 |
XDATA_ERR_NO_MEM |
|
12 |
XDATA_ERR_OPEN_FAILED |
|
13 |
XDATA_ERR_PARSER_CREATE |
|
14 |
XDATA_ERR_PARSE |
See Also: XDATA, XDATA Methods, Method Syntax
![]() |