Sign in Join
FPDoc Onlineexperiment

TJSONArray.Insert procedure

Member of TJSONArraypublicIn unit fpJson

Insert an element in the array.

Declaration

pascal
procedure Insert(Index: Integer)
procedure Insert(Index: Integer; Item: TJSONData)
procedure Insert(Index: Integer; I: Integer)
procedure Insert(Index: Integer; I: Int64)
procedure Insert(Index: Integer; I: QWord)
procedure Insert(Index: Integer; const S: UnicodeString)
procedure Insert(Index: Integer; const S: TJSONStringType)
procedure Insert(Index: Integer; F: TJSONFloat)
procedure Insert(Index: Integer; B: Boolean)
procedure Insert(Index: Integer; AnArray: TJSONArray)
procedure Insert(Index: Integer; AnObject: TJSONObject)

Arguments

Index

Position at which to insert the new value.

Item

JSON Data object to insert.

I

Integer value to insert.

S

String value to insert.

F

Floating point value to insert.

B

Boolean value to insert.

AnArray

JSON array to insert.

AnObject

JSON Object to insert.

Description

Insert adds a value or element to the array at position Index. Elements with index equal to or larger than Index are shifted. Like Add, it converts plain pascal values to JSON values.

Note that when inserting a TJSONData instance to the array, it is owned by the array. Index must be a value between 0 and Count-1.

Errors

If an invalid index is specified, an exception is raised.

See also

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