---
product: Chilkat
product_version: 11.7.0
language: delphidll
language_label: Delphi DLL
class: JsonArray
license: free
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/dd_CkJsonArrayRef.html
---
# Chilkat JsonArray — Delphi DLL — v11.7.0

> Chilkat 11.7.0 · language=delphidll · class=JsonArray
> Other versions: replace `11.7.0` in this URL. Other languages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/<lang>/classes/JsonArray.md`.
> Language-wide rules (install, unlock, error model, strings/bytes): `https://www.chilkatsoft.com/ai-docs/v/11.7.0/delphidll/guide.md`.

## Purpose

**Read, modify, search, and emit ordered JSON arrays.**

`Chilkat.JsonArray` is the JSON array companion to `Chilkat.JsonObject`. It represents an ordered list of JSON values and provides index-based methods for reading, inserting, replacing, deleting, swapping, searching, and emitting array data. It supports scalar values, nested objects, nested arrays, date/time parsing, exact numeric string handling, compact or pretty output, and search helpers for arrays of strings or arrays of objects.

**Ordered JSON values**

Work with JSON arrays as ordered lists containing strings, numbers, booleans, nulls, objects, arrays, and mixed value types.

**Index-based access**

Retrieve, insert, replace, delete, or swap values by array index when processing JSON list data.

**Nested objects and arrays**

Access child `JsonObject` and `JsonArray` values to navigate and modify deeper JSON structures.

**Search helpers**

Search arrays of strings or arrays of objects to locate matching values without manually scanning every element.

**Date and numeric handling**

Parse date/time values and preserve exact numeric strings when JSON data contains values that must not be rounded or reformatted.

**Emit JSON output**

Produce compact or pretty JSON output after array data has been loaded, edited, searched, or built programmatically.

**Common pattern:** Use `JsonObject` to navigate named members and JSON paths, then use `JsonArray` to iterate or modify ordered lists found within the object tree. Retrieve nested objects or arrays as needed, update values by index, and emit the final JSON in compact or pretty form.

For an extended overview, see [JsonArray Class Overview](https://www.chilkatsoft.com/jsonarray_class_overview.asp).

## Object creation, unlocking and error handling

**Create/Dispose**

```pascal
var
myObject: HCkJsonArray;

begin
myObject := CkJsonArray_Create();

// ...

CkJsonArray_Dispose(myObject);
end;
```

`function CkJsonArray_Create: HCkJsonArray; stdcall;`

Creates an instance of the HCkJsonArray object and returns a handle (i.e. a Pointer). The handle is passed in the 1st argument for the functions listed on this page.

`procedure CkJsonArray_Dispose(handle: HCkJsonArray); stdcall;`

Objects created by calling CkJsonArray_Create must be freed by calling this method. A memory leak occurs if a handle is not disposed by calling this function.

Call `Global.UnlockBundle` once at the start of the program, before using this or any other Chilkat class. Any string unlocks a fully functional 30-day trial; a purchased unlock code is used in production. See `guide.md` for the exact code in Delphi DLL.

## Members common to every Chilkat class

Documented once per language in `common-members.md`; listed here so this page is self-contained.

| Property | Signature | Access | Meaning |
|---|---|---|---|
| `DebugLogFilePath` | `procedure CkJsonArray_getDebugLogFilePath(objHandle: HCkJsonArray; outPropVal: HCkString); stdcall; procedure CkJsonArray_putDebugLogFilePath(objHandle: HCkJsonArray; newPropVal: PWideChar); stdcall; function CkJsonArray__debugLogFilePath(objHandle: HCkJsonArray): PWideChar; stdcall;` | read/write | If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. |
| `LastErrorHtml` | `procedure CkJsonArray_getLastErrorHtml(objHandle: HCkJsonArray; outPropVal: HCkString); stdcall; function CkJsonArray__lastErrorHtml(objHandle: HCkJsonArray): PWideChar; stdcall;` | read-only | Provides HTML-formatted information about the last called method or property. |
| `LastErrorText` | `procedure CkJsonArray_getLastErrorText(objHandle: HCkJsonArray; outPropVal: HCkString); stdcall; function CkJsonArray__lastErrorText(objHandle: HCkJsonArray): PWideChar; stdcall;` | read-only | Provides plain text information about the last called method or property. |
| `LastErrorXml` | `procedure CkJsonArray_getLastErrorXml(objHandle: HCkJsonArray; outPropVal: HCkString); stdcall; function CkJsonArray__lastErrorXml(objHandle: HCkJsonArray): PWideChar; stdcall;` | read-only | Provides XML-formatted information about the last called method or property. |
| `LastMethodSuccess` | `function CkJsonArray_getLastMethodSuccess(objHandle: HCkJsonArray): wordbool; stdcall; procedure CkJsonArray_putLastMethodSuccess(objHandle: HCkJsonArray; newPropVal: wordbool); stdcall;` | read/write | Indicates the success or failure of the most recent method call: `True` means success, `False` means failure. |
| `VerboseLogging` | `function CkJsonArray_getVerboseLogging(objHandle: HCkJsonArray): wordbool; stdcall; procedure CkJsonArray_putVerboseLogging(objHandle: HCkJsonArray; newPropVal: wordbool); stdcall;` | read/write | If set to `True`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. |
| `Version` | `procedure CkJsonArray_getVersion(objHandle: HCkJsonArray; outPropVal: HCkString); stdcall; function CkJsonArray__version(objHandle: HCkJsonArray): PWideChar; stdcall;` | read-only | Version of the component/library, such as "10.1.0" |

## Member index

| Member | Kind | Signature |
|---|---|---|
| `EmitCompact` | property, read/write | `function CkJsonArray_getEmitCompact(objHandle: HCkJsonArray): wordbool; stdcall; procedure CkJsonArray_putEmitCompact(objHandle: HCkJsonArray; newPropVal: wordbool); stdcall;` |
| `EmitCrlf` | property, read/write | `function CkJsonArray_getEmitCrlf(objHandle: HCkJsonArray): wordbool; stdcall; procedure CkJsonArray_putEmitCrlf(objHandle: HCkJsonArray; newPropVal: wordbool); stdcall;` |
| `FindStartIndex` | property, read/write | `function CkJsonArray_getFindStartIndex(objHandle: HCkJsonArray): Integer; stdcall; procedure CkJsonArray_putFindStartIndex(objHandle: HCkJsonArray; newPropVal: Integer); stdcall;` |
| `Size` | property, read-only | `function CkJsonArray_getSize(objHandle: HCkJsonArray): Integer; stdcall;` |
| `AddArrayAt` | method | `function CkJsonArray_AddArrayAt(objHandle: HCkJsonArray;     index: Integer): wordbool; stdcall;` |
| `AddArrayAt2` | method | `function CkJsonArray_AddArrayAt2(objHandle: HCkJsonArray;     index: Integer;     jarr: HCkJsonArray): wordbool; stdcall;` |
| `AddBoolAt` | method | `function CkJsonArray_AddBoolAt(objHandle: HCkJsonArray;     index: Integer;     value: wordbool): wordbool; stdcall;` |
| `AddIntAt` | method | `function CkJsonArray_AddIntAt(objHandle: HCkJsonArray;     index: Integer;     value: Integer): wordbool; stdcall;` |
| `AddNullAt` | method | `function CkJsonArray_AddNullAt(objHandle: HCkJsonArray;     index: Integer): wordbool; stdcall;` |
| `AddNumberAt` | method | `function CkJsonArray_AddNumberAt(objHandle: HCkJsonArray;     index: Integer;     numericStr: PWideChar): wordbool; stdcall;` |
| `AddObjectAt` | method | `function CkJsonArray_AddObjectAt(objHandle: HCkJsonArray;     index: Integer): wordbool; stdcall;` |
| `AddObjectAt2` | method | `function CkJsonArray_AddObjectAt2(objHandle: HCkJsonArray;     index: Integer;     json: HCkJsonObject): wordbool; stdcall;` |
| `AddObjectCopyAt` | method | `function CkJsonArray_AddObjectCopyAt(objHandle: HCkJsonArray;     index: Integer;     jsonObj: HCkJsonObject): wordbool; stdcall;` |
| `AddStringAt` | method | `function CkJsonArray_AddStringAt(objHandle: HCkJsonArray;     index: Integer;     value: PWideChar): wordbool; stdcall;` |
| `AddUIntAt` | method | `function CkJsonArray_AddUIntAt(objHandle: HCkJsonArray;     index: Integer;     value: LongWord): wordbool; stdcall;` |
| `AppendArrayItems` | method | `function CkJsonArray_AppendArrayItems(objHandle: HCkJsonArray;     jarr: HCkJsonArray): wordbool; stdcall;` |
| `ArrayAt` | method | `function CkJsonArray_ArrayAt(objHandle: HCkJsonArray;     index: Integer): HCkJsonArray; stdcall;` |
| `ArrayAt2` | method | `function CkJsonArray_ArrayAt2(objHandle: HCkJsonArray;     index: Integer;     jarr: HCkJsonArray): wordbool; stdcall;` |
| `BoolAt` | method | `function CkJsonArray_BoolAt(objHandle: HCkJsonArray;     index: Integer): wordbool; stdcall;` |
| `Clear` | method | `procedure CkJsonArray_Clear(objHandle: HCkJsonArray) stdcall;` |
| `DateAt` | method | `function CkJsonArray_DateAt(objHandle: HCkJsonArray;     index: Integer;     dt: HCkDateTime): wordbool; stdcall;` |
| `DeleteAt` | method | `function CkJsonArray_DeleteAt(objHandle: HCkJsonArray;     index: Integer): wordbool; stdcall;` |
| `DtAt` | method | `function CkJsonArray_DtAt(objHandle: HCkJsonArray;     index: Integer;     bLocal: wordbool;     dt: HCkDtObj): wordbool; stdcall;` |
| `Emit` | method | `function CkJsonArray_Emit(objHandle: HCkJsonArray;     outStr: HCkString): wordbool; stdcall; function CkJsonArray__emit(objHandle: HCkJsonArray): PWideChar; stdcall;` |
| `EmitSb` | method | `function CkJsonArray_EmitSb(objHandle: HCkJsonArray;     sb: HCkStringBuilder): wordbool; stdcall;` |
| `FindObject` | method | `function CkJsonArray_FindObject(objHandle: HCkJsonArray;     name: PWideChar;     value: PWideChar;     caseSensitive: wordbool): Integer; stdcall;` |
| `FindString` | method | `function CkJsonArray_FindString(objHandle: HCkJsonArray;     value: PWideChar;     caseSensitive: wordbool): Integer; stdcall;` |
| `IntAt` | method | `function CkJsonArray_IntAt(objHandle: HCkJsonArray;     index: Integer): Integer; stdcall;` |
| `IsNullAt` | method | `function CkJsonArray_IsNullAt(objHandle: HCkJsonArray;     index: Integer): wordbool; stdcall;` |
| `Load` | method | `function CkJsonArray_Load(objHandle: HCkJsonArray;     jsonArray: PWideChar): wordbool; stdcall;` |
| `LoadSb` | method | `function CkJsonArray_LoadSb(objHandle: HCkJsonArray;     sb: HCkStringBuilder): wordbool; stdcall;` |
| `ObjectAt` | method | `function CkJsonArray_ObjectAt(objHandle: HCkJsonArray;     index: Integer): HCkJsonObject; stdcall;` |
| `ObjectAt2` | method | `function CkJsonArray_ObjectAt2(objHandle: HCkJsonArray;     index: Integer;     jsonObj: HCkJsonObject): wordbool; stdcall;` |
| `SetBoolAt` | method | `function CkJsonArray_SetBoolAt(objHandle: HCkJsonArray;     index: Integer;     value: wordbool): wordbool; stdcall;` |
| `SetIntAt` | method | `function CkJsonArray_SetIntAt(objHandle: HCkJsonArray;     index: Integer;     value: Integer): wordbool; stdcall;` |
| `SetNullAt` | method | `function CkJsonArray_SetNullAt(objHandle: HCkJsonArray;     index: Integer): wordbool; stdcall;` |
| `SetNumberAt` | method | `function CkJsonArray_SetNumberAt(objHandle: HCkJsonArray;     index: Integer;     value: PWideChar): wordbool; stdcall;` |
| `SetStringAt` | method | `function CkJsonArray_SetStringAt(objHandle: HCkJsonArray;     index: Integer;     value: PWideChar): wordbool; stdcall;` |
| `SetUIntAt` | method | `function CkJsonArray_SetUIntAt(objHandle: HCkJsonArray;     index: Integer;     value: LongWord): wordbool; stdcall;` |
| `StringAt` | method | `function CkJsonArray_StringAt(objHandle: HCkJsonArray;     index: Integer;     outStr: HCkString): wordbool; stdcall; function CkJsonArray__stringAt(objHandle: HCkJsonArray;     index: Integer): PWideChar; stdcall;` |
| `Swap` | method | `function CkJsonArray_Swap(objHandle: HCkJsonArray;     index1: Integer;     index2: Integer): wordbool; stdcall;` |
| `TypeAt` | method | `function CkJsonArray_TypeAt(objHandle: HCkJsonArray;     index: Integer): Integer; stdcall;` |
| `UIntAt` | method | `function CkJsonArray_UIntAt(objHandle: HCkJsonArray;     index: Integer): LongWord; stdcall;` |

## Properties

### JsonArray.EmitCompact

`Chilkat 11.7.0 · delphidll · JsonArray · EmitCompact · property · read/write · since 9.5.0.64`

```pascal
function CkJsonArray_getEmitCompact(objHandle: HCkJsonArray): wordbool; stdcall;
procedure CkJsonArray_putEmitCompact(objHandle: HCkJsonArray; newPropVal: wordbool); stdcall;
```

Controls whether emitted JSON is compact or pretty-formatted. If `True`, output contains no unnecessary whitespace and is emitted on a single line. If `False`, indentation and line breaks are added for readability. The default is `True`.

### JsonArray.EmitCrlf

`Chilkat 11.7.0 · delphidll · JsonArray · EmitCrlf · property · read/write · since 9.5.0.64`

```pascal
function CkJsonArray_getEmitCrlf(objHandle: HCkJsonArray): wordbool; stdcall;
procedure CkJsonArray_putEmitCrlf(objHandle: HCkJsonArray; newPropVal: wordbool); stdcall;
```

Controls line endings when pretty-formatted JSON is emitted. If `True`, line breaks use CRLF (); if `False`, they use LF (). The default is `True`.

**Applies only to pretty output:** When `EmitCompact` is `True`, the JSON is emitted on one line and this setting has no effect.

### JsonArray.FindStartIndex

`Chilkat 11.7.0 · delphidll · JsonArray · FindStartIndex · property · read/write · since 11.6.0`

```pascal
function CkJsonArray_getFindStartIndex(objHandle: HCkJsonArray): Integer; stdcall;
procedure CkJsonArray_putFindStartIndex(objHandle: HCkJsonArray; newPropVal: Integer); stdcall;
```

Specifies the zero-based array index at which `FindString` and `FindObject` begin searching. The default value is `0`.

**Iterating matches:** After finding a match at index `n`, set this property to `n + 1` before the next search to continue with later elements.

### JsonArray.Size

`Chilkat 11.7.0 · delphidll · JsonArray · Size · property · read-only · since 9.5.0.56`

```pascal
function CkJsonArray_getSize(objHandle: HCkJsonArray): Integer; stdcall;
```

Returns the number of values currently contained in the JSON array. Array indexes therefore range from `0` through `Size - 1`.

## Methods

### JsonArray.AddArrayAt

`Chilkat 11.7.0 · delphidll · JsonArray · AddArrayAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_AddArrayAt(objHandle: HCkJsonArray;
    index: Integer): wordbool; stdcall;
```

Inserts a new, empty JSON array at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Insert vs. replace:** The `Add*At` methods insert a new array element. Use the corresponding `Set*At` method when replacing an existing element.

Returns True for success, False for failure.

### JsonArray.AddArrayAt2

`Chilkat 11.7.0 · delphidll · JsonArray · AddArrayAt2 · method · since 11.1.0`

```pascal
function CkJsonArray_AddArrayAt2(objHandle: HCkJsonArray;
    index: Integer;
    jarr: HCkJsonArray): wordbool; stdcall;
```

Inserts a new, empty JSON array at zero-based position `index` and updates `jarr` to reference the newly inserted array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Immediate editing:** Because `jarr` references the inserted array, it can be populated directly without a separate `ArrayAt` lookup.

Returns True for success, False for failure.

### JsonArray.AddBoolAt

`Chilkat 11.7.0 · delphidll · JsonArray · AddBoolAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_AddBoolAt(objHandle: HCkJsonArray;
    index: Integer;
    value: wordbool): wordbool; stdcall;
```

Inserts a new JSON boolean value at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Insert vs. replace:** The `Add*At` methods insert a new array element. Use the corresponding `Set*At` method when replacing an existing element.

Returns True for success, False for failure.

### JsonArray.AddIntAt

`Chilkat 11.7.0 · delphidll · JsonArray · AddIntAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_AddIntAt(objHandle: HCkJsonArray;
    index: Integer;
    value: Integer): wordbool; stdcall;
```

Inserts a new JSON integer value at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Insert vs. replace:** The `Add*At` methods insert a new array element. Use the corresponding `Set*At` method when replacing an existing element.

Returns True for success, False for failure.

### JsonArray.AddNullAt

`Chilkat 11.7.0 · delphidll · JsonArray · AddNullAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_AddNullAt(objHandle: HCkJsonArray;
    index: Integer): wordbool; stdcall;
```

Inserts a JSON `null` value at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Insert vs. replace:** The `Add*At` methods insert a new array element. Use the corresponding `Set*At` method when replacing an existing element.

Returns True for success, False for failure.

### JsonArray.AddNumberAt

`Chilkat 11.7.0 · delphidll · JsonArray · AddNumberAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_AddNumberAt(objHandle: HCkJsonArray;
    index: Integer;
    numericStr: PWideChar): wordbool; stdcall;
```

Inserts a JSON number at zero-based position `index`. The `numericStr` argument supplies the exact JSON numeric text to store. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Exact numeric text:** Use this method when lexical form or precision matters, for example `12345678901234567890`, `1.2500`, or scientific notation. The supplied text must be valid JSON number syntax; JSON does not permit `NaN` or infinity.

Returns True for success, False for failure.

### JsonArray.AddObjectAt

`Chilkat 11.7.0 · delphidll · JsonArray · AddObjectAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_AddObjectAt(objHandle: HCkJsonArray;
    index: Integer): wordbool; stdcall;
```

Inserts a new, empty JSON object at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Insert vs. replace:** The `Add*At` methods insert a new array element. Use the corresponding `Set*At` method when replacing an existing element.

Returns True for success, False for failure.

### JsonArray.AddObjectAt2

`Chilkat 11.7.0 · delphidll · JsonArray · AddObjectAt2 · method · since 11.1.0`

```pascal
function CkJsonArray_AddObjectAt2(objHandle: HCkJsonArray;
    index: Integer;
    json: HCkJsonObject): wordbool; stdcall;
```

Inserts a new, empty JSON object at zero-based position `index` and updates `json` to reference the newly inserted object.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Immediate editing:** Because `json` references the inserted object, it can be populated directly without a separate `ObjectAt` lookup.

Returns True for success, False for failure.

### JsonArray.AddObjectCopyAt

`Chilkat 11.7.0 · delphidll · JsonArray · AddObjectCopyAt · method · since 9.5.0.82`

```pascal
function CkJsonArray_AddObjectCopyAt(objHandle: HCkJsonArray;
    index: Integer;
    jsonObj: HCkJsonObject): wordbool; stdcall;
```

Inserts an independent copy of `jsonObj` at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Copy semantics:** The inserted object is copied rather than referenced. Later changes to the source `jsonObj` do not serve as edits to the inserted array value.

Returns True for success, False for failure.

### JsonArray.AddStringAt

`Chilkat 11.7.0 · delphidll · JsonArray · AddStringAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_AddStringAt(objHandle: HCkJsonArray;
    index: Integer;
    value: PWideChar): wordbool; stdcall;
```

Inserts a new JSON string value at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Insert vs. replace:** The `Add*At` methods insert a new array element. Use the corresponding `Set*At` method when replacing an existing element.

Returns True for success, False for failure.

### JsonArray.AddUIntAt

`Chilkat 11.7.0 · delphidll · JsonArray · AddUIntAt · method · since 9.5.0.96`

```pascal
function CkJsonArray_AddUIntAt(objHandle: HCkJsonArray;
    index: Integer;
    value: LongWord): wordbool; stdcall;
```

Inserts a new JSON unsigned integer value at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Insert vs. replace:** The `Add*At` methods insert a new array element. Use the corresponding `Set*At` method when replacing an existing element.

Returns True for success, False for failure.

### JsonArray.AppendArrayItems

`Chilkat 11.7.0 · delphidll · JsonArray · AppendArrayItems · method · since 9.5.0.82`

```pascal
function CkJsonArray_AppendArrayItems(objHandle: HCkJsonArray;
    jarr: HCkJsonArray): wordbool; stdcall;
```

Appends copies of all values from `jarr` to the end of this array, preserving their order.

**Source is unchanged:** The source array is not emptied or moved. This method is useful for concatenating JSON arrays, including arrays belonging to different JSON documents.

Returns True for success, False for failure.

### JsonArray.ArrayAt

`Chilkat 11.7.0 · delphidll · JsonArray · ArrayAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_ArrayAt(objHandle: HCkJsonArray;
    index: Integer): HCkJsonArray; stdcall;
```

Returns the nested JSON array stored at zero-based position `index`.

**Reference, not copy:** The returned `JsonArray` refers to the existing nested array in the same JSON document. Changes made through the returned object modify that nested array.

**Type requirement:** The value at `index` must be an array. Use `TypeAt` when the value type is not already known.

Returns `nil` on failure

### JsonArray.ArrayAt2

`Chilkat 11.7.0 · delphidll · JsonArray · ArrayAt2 · method · since 11.0.0`

```pascal
function CkJsonArray_ArrayAt2(objHandle: HCkJsonArray;
    index: Integer;
    jarr: HCkJsonArray): wordbool; stdcall;
```

Updates `jarr` so that it references the nested JSON array stored at zero-based position `index`.

**Reference, not copy:** Changes made through `jarr` modify the existing nested array in the same JSON document.

Returns True for success, False for failure.

### JsonArray.BoolAt

`Chilkat 11.7.0 · delphidll · JsonArray · BoolAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_BoolAt(objHandle: HCkJsonArray;
    index: Integer): wordbool; stdcall;
```

Returns the boolean value stored at zero-based position `index`.

**Type-aware access:** Use `TypeAt` when the JSON type at `index` is not already known.

### JsonArray.Clear

`Chilkat 11.7.0 · delphidll · JsonArray · Clear · method · since 9.5.0.76`

```pascal
procedure CkJsonArray_Clear(objHandle: HCkJsonArray) stdcall;
```

Removes all values from the array, leaving an empty JSON array (`[]`).

### JsonArray.DateAt

`Chilkat 11.7.0 · delphidll · JsonArray · DateAt · method · since 9.5.0.73`

```pascal
function CkJsonArray_DateAt(objHandle: HCkJsonArray;
    index: Integer;
    dt: HCkDateTime): wordbool; stdcall;
```

Parses the date/time value at zero-based position `index` and loads the result into `dt`. Recognized forms include ISO 8601 timestamps (for example, `2009-11-04T19:55:41Z`), RFC 822-style date/time strings, and Unix timestamp integers.

**JSON has no native date type:** Dates are application conventions represented as strings or numbers. These methods recognize common representations and convert them to Chilkat date/time objects.

Returns True for success, False for failure.

### JsonArray.DeleteAt

`Chilkat 11.7.0 · delphidll · JsonArray · DeleteAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_DeleteAt(objHandle: HCkJsonArray;
    index: Integer): wordbool; stdcall;
```

Deletes the value at zero-based position `index`. Elements following the deleted value shift down by one position.

Returns True for success, False for failure.

### JsonArray.DtAt

`Chilkat 11.7.0 · delphidll · JsonArray · DtAt · method · since 9.5.0.73`

```pascal
function CkJsonArray_DtAt(objHandle: HCkJsonArray;
    index: Integer;
    bLocal: wordbool;
    dt: HCkDtObj): wordbool; stdcall;
```

Parses the date/time value at zero-based position `index` and loads the result into `dt`. If `bLocal` is `True`, the populated fields represent local time; if `False`, they represent UTC/GMT. Recognized forms include ISO 8601 timestamps, RFC 822-style date/time strings, and Unix timestamp integers.

**JSON has no native date type:** Dates are application conventions represented as strings or numbers. These methods recognize common representations and convert them to Chilkat date/time objects.

Returns True for success, False for failure.

### JsonArray.Emit

`Chilkat 11.7.0 · delphidll · JsonArray · Emit · method · since 9.5.0.58`

```pascal
function CkJsonArray_Emit(objHandle: HCkJsonArray;
    outStr: HCkString): wordbool; stdcall;
function CkJsonArray__emit(objHandle: HCkJsonArray): PWideChar; stdcall;
```

Serializes this JSON array and returns the resulting JSON text.

**Formatting:** Set `EmitCompact` to choose compact versus pretty output. When pretty output is enabled, `EmitCrlf` selects CRLF or LF line endings.

Returns True for success, False for failure.

See the notes about [PWideChar memory ownership and validity](https://www.chilkatsoft.com/delphi_pwidechar.asp).

### JsonArray.EmitSb

`Chilkat 11.7.0 · delphidll · JsonArray · EmitSb · method · since 9.5.0.65`

```pascal
function CkJsonArray_EmitSb(objHandle: HCkJsonArray;
    sb: HCkStringBuilder): wordbool; stdcall;
```

Serializes this JSON array into the supplied `StringBuilder`.

**Formatting:** Set `EmitCompact` to choose compact versus pretty output. When pretty output is enabled, `EmitCrlf` selects CRLF or LF line endings.

**Large JSON:** Using a `StringBuilder` can avoid returning a very large JSON document as a language-native string before passing it to another Chilkat method or writing it to a file.

Returns True for success, False for failure.

### JsonArray.FindObject

`Chilkat 11.7.0 · delphidll · JsonArray · FindObject · method · since 9.5.0.73`

```pascal
function CkJsonArray_FindObject(objHandle: HCkJsonArray;
    name: PWideChar;
    value: PWideChar;
    caseSensitive: wordbool): Integer; stdcall;
```

Searches array elements that are JSON objects and returns the zero-based index of the first object whose direct member `name` has a value matching `value`. Returns `-1` if no match is found. The value pattern may contain `*`, which matches zero or more characters. Set `caseSensitive` to control whether letter case must match.

**Member name, not JSON path:** `name` identifies a direct member of each object being tested; it is not a JSON path.

**Search start:** Searching begins at `FindStartIndex`, whose default is `0`. To continue searching after a match, set `FindStartIndex` to the previous returned index plus 1.

### JsonArray.FindString

`Chilkat 11.7.0 · delphidll · JsonArray · FindString · method · since 9.5.0.73`

```pascal
function CkJsonArray_FindString(objHandle: HCkJsonArray;
    value: PWideChar;
    caseSensitive: wordbool): Integer; stdcall;
```

Searches for the first string array element matching `value` and returns its zero-based index, or `-1` if no match is found. The pattern may contain `*`, which matches zero or more characters. Set `caseSensitive` to control whether letter case must match.

**Search start:** Searching begins at `FindStartIndex`, whose default is `0`. To continue searching after a match, set `FindStartIndex` to the previous returned index plus 1.

### JsonArray.IntAt

`Chilkat 11.7.0 · delphidll · JsonArray · IntAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_IntAt(objHandle: HCkJsonArray;
    index: Integer): Integer; stdcall;
```

Returns the integer value stored at zero-based position `index`.

**Type-aware access:** Use `TypeAt` when the JSON type at `index` is not already known.

### JsonArray.IsNullAt

`Chilkat 11.7.0 · delphidll · JsonArray · IsNullAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_IsNullAt(objHandle: HCkJsonArray;
    index: Integer): wordbool; stdcall;
```

Returns `True` if the value at zero-based position `index` is the JSON value `null`; otherwise returns `False`.

**JSON null:** `null` is a distinct JSON value. It is not the same as an empty string, zero, `false`, an empty object, or an empty array.

### JsonArray.Load

`Chilkat 11.7.0 · delphidll · JsonArray · Load · method · since 9.5.0.64`

```pascal
function CkJsonArray_Load(objHandle: HCkJsonArray;
    jsonArray: PWideChar): wordbool; stdcall;
```

Parses the JSON array text in `jsonArray` and loads it into this object. The input must represent a JSON array, beginning with `[` and ending with `]`.

**Important — loading detaches the array:** Calling this method makes the `JsonArray` its own independent JSON document. If the object previously referenced an array nested inside another JSON document, that relationship is discarded. For this reason, call `Load`/`LoadSb` on a new `JsonArray` instance.

Returns True for success, False for failure.

### JsonArray.LoadSb

`Chilkat 11.7.0 · delphidll · JsonArray · LoadSb · method · since 9.5.0.64`

```pascal
function CkJsonArray_LoadSb(objHandle: HCkJsonArray;
    sb: HCkStringBuilder): wordbool; stdcall;
```

Parses the JSON array contained in `sb` and loads it into this object. The input must represent a JSON array, beginning with `[` and ending with `]`.

**Important — loading detaches the array:** Calling this method makes the `JsonArray` its own independent JSON document. If the object previously referenced an array nested inside another JSON document, that relationship is discarded. For this reason, call `Load`/`LoadSb` on a new `JsonArray` instance.

Returns True for success, False for failure.

### JsonArray.ObjectAt

`Chilkat 11.7.0 · delphidll · JsonArray · ObjectAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_ObjectAt(objHandle: HCkJsonArray;
    index: Integer): HCkJsonObject; stdcall;
```

Returns the JSON object stored at zero-based position `index`.

**Reference, not copy:** The returned `JsonObject` refers to the existing object in the same JSON document. Changes made through the returned object modify that nested object.

**Type requirement:** The value at `index` must be an object. Use `TypeAt` when the value type is not already known.

Returns `nil` on failure

### JsonArray.ObjectAt2

`Chilkat 11.7.0 · delphidll · JsonArray · ObjectAt2 · method · since 11.0.0`

```pascal
function CkJsonArray_ObjectAt2(objHandle: HCkJsonArray;
    index: Integer;
    jsonObj: HCkJsonObject): wordbool; stdcall;
```

Updates `jsonObj` so that it references the JSON object stored at zero-based position `index`.

**Reference, not copy:** Changes made through `jsonObj` modify the existing object in the same JSON document.

Returns True for success, False for failure.

### JsonArray.SetBoolAt

`Chilkat 11.7.0 · delphidll · JsonArray · SetBoolAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_SetBoolAt(objHandle: HCkJsonArray;
    index: Integer;
    value: wordbool): wordbool; stdcall;
```

Replaces the value at zero-based position `index` with the specified JSON boolean value. The array length and the positions of other elements are unchanged.

Returns True for success, False for failure.

### JsonArray.SetIntAt

`Chilkat 11.7.0 · delphidll · JsonArray · SetIntAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_SetIntAt(objHandle: HCkJsonArray;
    index: Integer;
    value: Integer): wordbool; stdcall;
```

Replaces the value at zero-based position `index` with the specified JSON integer value. The array length and the positions of other elements are unchanged.

Returns True for success, False for failure.

### JsonArray.SetNullAt

`Chilkat 11.7.0 · delphidll · JsonArray · SetNullAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_SetNullAt(objHandle: HCkJsonArray;
    index: Integer): wordbool; stdcall;
```

Replaces the value at zero-based position `index` with the JSON value `null`. The array length and the positions of other elements are unchanged.

Returns True for success, False for failure.

### JsonArray.SetNumberAt

`Chilkat 11.7.0 · delphidll · JsonArray · SetNumberAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_SetNumberAt(objHandle: HCkJsonArray;
    index: Integer;
    value: PWideChar): wordbool; stdcall;
```

Replaces the value at zero-based position `index` with a JSON number. The `value` argument supplies the exact JSON numeric text to store.

**Exact numeric text:** Use this method when lexical form or precision matters. The supplied text must be valid JSON number syntax; JSON does not permit `NaN` or infinity.

Returns True for success, False for failure.

### JsonArray.SetStringAt

`Chilkat 11.7.0 · delphidll · JsonArray · SetStringAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_SetStringAt(objHandle: HCkJsonArray;
    index: Integer;
    value: PWideChar): wordbool; stdcall;
```

Replaces the value at zero-based position `index` with the specified JSON string value. The array length and the positions of other elements are unchanged.

Returns True for success, False for failure.

### JsonArray.SetUIntAt

`Chilkat 11.7.0 · delphidll · JsonArray · SetUIntAt · method · since 9.5.0.96`

```pascal
function CkJsonArray_SetUIntAt(objHandle: HCkJsonArray;
    index: Integer;
    value: LongWord): wordbool; stdcall;
```

Replaces the value at zero-based position `index` with the specified JSON unsigned integer value. The array length and the positions of other elements are unchanged.

Returns True for success, False for failure.

### JsonArray.StringAt

`Chilkat 11.7.0 · delphidll · JsonArray · StringAt · method · since 9.5.0.56`

```pascal
function CkJsonArray_StringAt(objHandle: HCkJsonArray;
    index: Integer;
    outStr: HCkString): wordbool; stdcall;
function CkJsonArray__stringAt(objHandle: HCkJsonArray;
    index: Integer): PWideChar; stdcall;
```

Returns the string value stored at zero-based position `index`.

**Type-aware access:** Use `TypeAt` when the JSON type at `index` is not already known.

Returns True for success, False for failure.

See the notes about [PWideChar memory ownership and validity](https://www.chilkatsoft.com/delphi_pwidechar.asp).

### JsonArray.Swap

`Chilkat 11.7.0 · delphidll · JsonArray · Swap · method · since 9.5.0.76`

```pascal
function CkJsonArray_Swap(objHandle: HCkJsonArray;
    index1: Integer;
    index2: Integer): wordbool; stdcall;
```

Exchanges the values at zero-based positions `index1` and `index2`. The array length does not change.

Returns True for success, False for failure.

### JsonArray.TypeAt

`Chilkat 11.7.0 · delphidll · JsonArray · TypeAt · method · since 9.5.0.58`

```pascal
function CkJsonArray_TypeAt(objHandle: HCkJsonArray;
    index: Integer): Integer; stdcall;
```

Returns an integer identifying the JSON type of the value at zero-based position `index`. Returns `-1` if no value exists at that index.

|  |  |
| --- | --- |
| `1` | string |
| `2` | number |
| `3` | object |
| `4` | array |
| `5` | boolean |
| `6` | null |

**Why use TypeAt:** JSON arrays may contain mixed types. Checking the type first avoids choosing a type-specific accessor such as `ObjectAt`, `ArrayAt`, or `IntAt` for the wrong kind of value.

### JsonArray.UIntAt

`Chilkat 11.7.0 · delphidll · JsonArray · UIntAt · method · since 9.5.0.96`

```pascal
function CkJsonArray_UIntAt(objHandle: HCkJsonArray;
    index: Integer): LongWord; stdcall;
```

Returns the unsigned integer value stored at zero-based position `index`.

**Type-aware access:** Use `TypeAt` when the JSON type at `index` is not already known.

## Related classes

[`CkDateTime`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/delphidll/classes/CkDateTime.md), [`DtObj`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/delphidll/classes/DtObj.md), [`JsonObject`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/delphidll/classes/JsonObject.md), [`StringBuilder`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/delphidll/classes/StringBuilder.md)

