[Overview][Constants][Types][Classes][Index] | Reference for unit 'fpjson' (#fcl)

# TJSONData.FormatJSON

Return a formatted JSON representation of the data.

## Declaration

Source position: fpjson.pp line 101

`public function TJSONData.FormatJSON(`
`Options: TFormatOptions = DefaultFormat;`
`Indentsize: Integer = DefaultIndentSize`
`):TJSONStringType;`

## Arguments

`Options` |  | Formatting options to apply
`Indentsize` |  | Amount of indent to use when starting new lines.

## Function result

The JSON representation of the instance.

## Description

FormatJSON returns a formatted JSON representation of the data. For simple JSON values, this is the same representation as the AsJSON property, but for complex values (TJSONArray and TJSONObject) the JSON is formatted differently.

There are some optional parameters to control the formatting. Options controls the use of whitespace and newlines. IndentSize controls the amount of indent applied when starting a new line.

The implementation is not optimized for speed.

## See also

AsJSON
TFormatOptions |  | Set of TFormatOption options.

Documentation generated on: Feb 26 2014