Serializes the JsonArray and any JsonConstructs it references to an output file. This is a recursive process resulting in a JSON representation of the entire set of JsonObjects and JsonArrays. On successful completion this method returns TRUE.
The method returns TRUE on successful serialization.
WriteFile( INPUT file-name AS CHARACTER,
INPUT formatted AS LOGICAL )
WriteFile( INPUT file-name AS CHARACTER,
INPUT formatted AS LOGICAL,
INPUT encoding AS CHARACTER )
file-name
A CHARACTER expression that specifies the name of a file to which the AVM writes the JSON string. You can specify the absolute path or a path relative to the current working directory. If a file with the specified name already exists, the AVM verifies that the file is writeable and overwrites the file.
formatted
An optional LOGICAL expression where TRUE directs the AVM to format the JSON string in a hierarchical manner using extra white space, carriage returns, and line feeds. The default value is FALSE.
If you specify the Unknown value (?), the method uses the default value of FALSE.
encoding
An optional string indicating the Unicode Transformation Format of the JSON string to be written. Valid values for UTF are "UTF-8", "UTF-16", "UTF-16BE", "UTF-16LE", "UTF-32", "UTF-32BE", and "UTF-32LE". If the value is the empty string (""), the Unknown value (?), or not given, the parameter defaults to "UTF-8".