Serializes the JsonConstruct (JsonObject or JsonArray) and any JsonConstructs it references. This is a recursive process resulting in a JSON representation of the entire set of JsonObjects and JsonArrays. On successful execution the method returns TRUE.
Return type: LOGICAL
Access: PUBLIC ABSTRACT
Applies to: Progress.Json.ObjectModel.JsonConstruct class
Write( INPUT stream-handle AS HANDLE, INPUT formatted AS LOGICAL) Write( INPUT stream-handle AS HANDLE, INPUT formatted AS LOGICAL, INPUT encoding AS CHARACTER) Write( INPUT-OUTPUT longchar AS LONGCHAR) Write( INPUT-OUTPUT longchar AS LONGCHAR, INPUT formatted AS LOGICAL) Write( INPUT-OUTPUT longchar AS LONGCHAR, INPUT formatted AS LOGICAL, INPUT encoding AS CHARACTER) Write( INPUT memptr AS MEMPTR) Write( INPUT memptr AS MEMPTR, INPUT formatted AS LOGICAL) Write( INPUT memptr AS MEMPTR, INPUT formatted AS LOGICAL, INPUT encoding AS CHARACTER) Write( OUTPUT character AS CHARACTER) Write( OUTPUT character AS CHARACTER, INPUT formatted AS LOGICAL) |
The AVM saves the JSON string to the LONGCHAR variable in the code page that corresponds to the character encoding you specify in the encoding option. If you do not specify a character encoding for the JSON string, the AVM saves the LONGCHAR variable in "UTF-8".
If the LONGCHAR variable's code page is fixed using the FIX-CODEPAGE statement and the fixed code page is not equivalent to the character encoding, this method raises a JsonError error.
If you specify the Unknown value (?), the method uses the default value of FALSE.