System.JSON.Writers.TJsonWriter.WriteEndArray

From RAD Studio API Documentation
Revision as of 11:13, 26 February 2016 by Simona.craciun (talk | contribs) (English review. RS-66777)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Delphi

procedure WriteEndArray; virtual;

C++

virtual void __fastcall WriteEndArray(void);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.JSON.Writers.pas
System.JSON.Writers.hpp
System.JSON.Writers TJsonWriter

Description

Writes the end of an array.

See the code snippet below to illustrate the use of WriteEndArray:

  Writer.WriteStartObject;
  Writer.WritePropertyName('colors');
  Writer.WriteStartArray;
  Writer.WriteStartObject;
  Writer.WriteComment('Hexadecimal value for the red color');
  Writer.WritePropertyName('name');
  Writer.WriteValue('red');
  Writer.WritePropertyName('hex');
  Writer.WriteValue('#f00');
  Writer.WriteEndObject;
  Writer.WriteEndArray;
{
  "colors": [
    {
      /*Hexadecimal value for the red color*/
      "name": "red",
      "hex": "#f00"
    }
  ]
}

See Also