Skip to content

TJSONArray.Add

Add a JSON value to the array.

Declaration

Source position: fpjson.pp line 571

public 
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;

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

Name Description
Delete Delete an element from the list by index.
Extract Extract an element from the array.