Sign in Join
FPDoc Onlineexperiment

TJSONArray.Add function

Member of TJSONArraypublicIn unit fpJson

Add a JSON value to the array.

Declaration

pascal
function Add(Item: TJSONData): Integer
function Add(I: Integer): Integer
function Add(I: Int64): Int64
function Add(I: QWord): QWord
function Add(const S: UnicodeString): Integer
function Add(const S: TJSONStringType): Integer
function Add: Integer
function Add(F: TJSONFloat): Integer
function Add(B: Boolean): Integer
function Add(AnArray: TJSONArray): Integer
function Add(AnObject: TJSONObject): Integer

Arguments

Item

TJSONData instance to add to array.

I

Integer value to add to array.

S

String value to add to array.

F

Floating point value to add to array.

B

Boolean value to array.

AnArray

JSON Array to add to array.

AnObject

JSON Object to add to array.

Function result

TJSONData instance that was added.

Description

Add adds the value passed on to the array. If it is a plain pascal value, it is converted to an appropriate TJSONData instance. If a TJSONData instance is passed, it is simply added to the array. Note that the instance will be owned by the array, and destroyed when the array is cleared (this is in particular true is an JSON array or object).

The function returns the TJSONData instance that was added to the array.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.