Make JSON Item Function
$MakeJSONItem is a wrapper for $MakeJSONArray and $MakeJSONObject call. It analyzes the passed parameters and calls one of mentioned functions.

$MakeJSONItem has following parameters:

  • ID item ID, unique positive integer value for references.
  • Object Name string, name or object as a constant or as a pattern. The engine will call $MakeJSONArray if this parameter is empty.
  • Is pattern 1 or true if the engine have to use object name as a pattern. Default (empty string) or any another value means name is constant.
  • Value definition is an integer reference item(s) ID (as array in '[]' like [2] or [2,3]) or pattern between '(' and ')'.
  • Repeater, optional, default is 1. N for 0 to N items, =N for exact N values or N:M for N to M values.

Examples

  1. $MakeJSONItem(1,,,($Rint()),=5) will call $MakeJSONArray(1,,,($Rint()),=5)
  2. $MakeJSONItem(2,CityN,1,($Lib(Cities)),4:5) will call $MakeJSONObject(2,CityN,1,($Lib(Cities)),4:5)