title: Trouble converting delphi objects with arrays to json
body: <p>I've been trying to translate my objects into a json string with TJson.ObjectToJsonString(object). It works fine for simple objects but it will break if the object contains an array(static or dynamic). What's the correct way of creating an json string of an object? I've looked at TSuperObject but it wasn't apparent what I would need to do. </p>
  
  <p>Class structure</p>
  
  <pre><code>TPerson = class(TObject)
  private
    FID       : integer;
    FLastName : string;
    FFirstName: string;
    FEmail    : string;
    fMyArray : array[0..2] of boolean;
  
    function ReadArray(i : integer):boolean;
    procedure WriteArray(i : integer; val:boolean);
  public
    property ID       : integer read FID        write FID;
    property LastName : string  read FLastName  write FLastName;
    property FirstName: string  read FFirstName write FFirstName;
    property Email    : string  read FEmail     write FEmail;
    property MyArray[i : integer] :boolean read ReadArray write WriteArray;
  end;
  </code></pre>
  
  <p>Example</p>
  
  <pre><code>  person := TPerson.create();
    person.ID := 25;
    person.FirstName := 'Homer';
    person.LastName  := 'Bologna';
    person.Email := 'Homer@Bologna.com';
  
    person.myArray[0] := true;
    person.myArray[1] := false;
    person.myArray[2] := true;
  
    str := TJson.ObjectToJsonString(person);//Access Violation
  </code></pre>