Store Method (JSONDATA)


10.8, PLBCMP GUI Only

 

The Store method is used to output a JSON string using the JSONDATA object nodes. This method uses the following format:

 

 

[label]

{object}.Store

[GIVING {return}] [USING [*OPTIONS=]{options}]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A JSONDATA object previously declared.

return

Optional. A Character Variable that returns the output JSON string. If an error occurs while generating the JSON output string, the Character Variable is returned as a NULL variable.

options

Optional. A Numeric Variable, decimal number, or Numeric expression that defines a bit mask value that is used to control the behaviors of this method.

Flags Affected: EOS, OVER, ZERO

Notes:

  1. The EOS flag is set if the output JSON string is truncated because the {return} variable is too small.

  2. The ZERO and OVER flags are always cleared.

  3. The {options} bit mask values are defined in plbmeth.inc file as follows:

  4.  

    Option

    Value

    Meaning

    $JSF_STORE_OUTPUT_INDENTION

    0x02

    Output JSON line with indention being used.

    $JSF_STORE_OUTPUT_CRLF

    0x04

    Output CR/LF EOR for each JSON line.

    $JSF_STORE_USE_TAB

    0x40

    Use one tab character (0x9) to indent JSON lines if this bit is set. Otherwise, blank characters (0x20) are used.

     

  5. If an error occurs, the JSONDATA object method 'SyntaxError' can be used to retrieve that last error that was generated.

 

 

See Also: Method Syntax, JSONDATA Methods



PL/B Language Reference