b = symbol_name.updateValueFromJson(json);
The
Symbol.updateValueFromJson function updates the value of a symbol based on the symbol's
JSON representation, passed to the function as the string expression
json.
You can also use the Logic.updateSymbolValue action to update a symbol's value.
The following table describes the value-related serialization routines available for CSPro objects and contains links to the description of the
JSON representation for each object.
Documentation about JSON representations feature will come in a future release. In the meantime you can see if the documentation is updated at:
The function returns a logical value of 1 (
true) if the symbol's value was successfully updated from its JSON representation and 0 (
false) otherwise.
List string usmca_countries
usmca_countries.updateValueFromJson("[ \"Canada\", \"Mexico\", \"United States\" ]");
// 3 countries are part of USMCA, including Canada and United States.
errmsg("%d countries are part of USMCA, including %s and %s.",
usmca_countries.length(),
usmca_countries(1), usmca_countries(usmca_countries.length()));