title: How to get a value from json with delphi
body: <p>I have this json and i want to get the <strong>fname</strong> value.
  How can i do it with Delphi</p>
  
  <pre><code>{  
     "root":[  
        {  
           "customers":[  
              {  
                 "fname":"George Makris",
                 "Age":12
              }
           ]
        }
     ]
  }
  </code></pre>
  
  <p>here is What i am doing Now but i dont think is the corect way</p>
  
  <pre><code>procedure TForm1.Button1Click(Sender: TObject);
    var s,json:string;
        myObj:TJSONObject;
        myarr:TJSONArray;
  begin
  
  json:='{"root":[{"customers":[ { "fname":"George Makris","Age":12}]}]}';
  myObj := TJSONObject.ParseJSONValue(json) as TJSONObject;
  myarr := myObj.GetValue('root') as TJSONArray;
  myObj := myarr.Items[0] as TJSONObject;
  myarr := myObj.GetValue('customers') as TJSONArray;
  myObj := myarr.Items[0] as TJSONObject;
  s := myObj.GetValue('fname').value;
  showmessage(s);
  end;
  </code></pre>