title: How to read fairly simple JSON file in Delphi Xe4?
body: <p>I've been struggling with this for a while, and doing something simple seems to be taking too long.</p>
  
  <p>I have a file like this:</p>
  
  <pre><code>[
   {
    "FirstName": "Oleg",
    "Surname": "Buckley"
   },
   {
    "FirstName": "Amery",
    "Surname": "Mcmillan"
   },
   {
    "FirstName": "Denton",
    "Surname": "Burnett"
  ....
  </code></pre>
  
  <p>I want to be able to read them into my program. So far I have worked up this pretty little function:</p>
  
  <pre><code>function GetGeneratedNames: TArray&lt;string&gt;;
  var fileName: TFileName;
    JSONValue, jv: TJSONValue;
    JSONArray: TJSONArray;
    jo: TJSONObject;
    pair: TJSONPair;
  begin
    result := nil;
    filename := ExePath + 'Names.json';
      JSONValue :=  TJSONObject.ParseJSONValue(TEncoding.ASCII.GetBytes(TFile.ReadAllText(filename)), 0);
      if JSONValue is TJSONArray then begin
       for jv in (JSONValue as TJSONArray) do begin
         if jv is TJSONObject then begin
           jo := jv as TJSONObject;
           for pair in jo do begin
             Append(result, jo.Value);
           end;
         end;
       end;
     end;
  end{ GetGeneratedNames};
  </code></pre>
  
  <p>The trouble is, it returns an array of blank strings. Can anyone point me in the right direction?</p>
  
  <p>TIA
  Mark</p>