JSONLib.convertFromJSON function

JSONLib.convertFromJSON copies a JSON string to a record, handler, or dictionary.

Package

eglx.json

Syntax
static function convertFromJSON(json string in,  eglType any const in);
json
A JSON string.
eglType
A record, handler, or dictionary.
Example use

Although the second parameter is declared as ANY type, the EGL runtime verifies that the input is a record, handler, or dictionary. Because of the declaration, you can use the function in a library function that accepts any type of variable, as in the following example:

function convert(myRecord MyRecordPart in, record2Populate ANY const in)
   jsonLib.convertFromJSON(myRecord.data, record2Populate);
end
Comments

For other details on the conversion, see “Correspondence between a JSON string and an EGL variable.”

JSONLib.convertFromJSON is the complement of the JSONLib.convertToJSON function.

Compatibility

Table 1. Compatibility
Target Issue
Java No issues.
JavaScript

The EGL runtime code rounds any numeric data that is greater than 15 significant digits.