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

# CreateJSON

Create a JSON data item

## Declaration

Source position: fpjson.pp line 774

`function CreateJSON: TJSONNull; function CreateJSON(`
`Data: Boolean`
`):TJSONBoolean; function CreateJSON(`
`Data: Integer`
`):TJSONIntegerNumber; function CreateJSON(`
`Data: Int64`
`):TJSONInt64Number; function CreateJSON(`
`Data: QWord`
`):TJSONQWordNumber; function CreateJSON(`
`Data: TJSONFloat`
`):TJSONFloatNumber; function CreateJSON(`
`const Data: TJSONStringType`
`):TJSONString; function CreateJSON(`
`const Data: TJSONUnicodeStringType`
`):TJSONString;`

## Function result

The TJSONData descendant representing the value in Data

## Arguments

`Data` |  | The data to create as a JSON data item.

## Arguments

`Data` |  | The data to create as a JSON data item.

## Arguments

`Data` |  | The data to create as a JSON data item.

## Arguments

`Data` |  | The data to create as a JSON data item.

## Arguments

`Data` |  | The data to create as a JSON data item.

## Arguments

`Data` |  | The data to create as a JSON data item.

## Arguments

`Data` |  | The data to create as a JSON data item.

## Description

CreateJSON will create a JSON Data item depending on the type of data passed to it, and will use the classes returned by GetJSONInstanceType to do so. The classes to be used can be set using the SetJSONInstanceType.

The JSON parser uses these functions to create instances of TJSONData.

## Errors

None.

## See also

GetJSONInstanceType |  | JSON factory: Get the JSONData class types to use
SetJSONInstanceType |  | JSON factory: Set the JSONData class types to use
GetJSON |  | Convert JSON string to JSON data structure
CreateJSONArray |  | Create a JSON array
CreateJSONObject |  | Create a JSON object

Documentation generated on: May 14 2021