TJSONObject and Pairs[]

Hi,
Is there a bug with TJSONObject and Pairs[].

In my pascal procedure I have something like this :
procedure MyProc(pJsonArray : TJSONArray);
var
aJSonRecord : TJSONObject;
aJsonPair : TJSONPair;

aJSonRecord := TJSONObject(pJsonArray.Items[0]);
for i:= 0 To aJSonRecord.Count-1 do
begin
aJsonPair := TJSONPair.Create;
aJsonPair := aJSonRecord.Pairs[i];
But aJsonPair is always null (not assigned)
the aJsonRecord is correctly assigned with a JSON object with couples (name:val)

is TJsonObject.Pairs[i] the only method to access to the name value in the couple (name:value) json object ?

Thank you

Found !

I must use Get(index) and not Pairs[index] to have couple (name:value) like this :

aJSonRecord := TJSONObject(pJsonArray.Items[0]); // First line of JsonArray

for i:= 0 To aJSonRecord.Count-1 do
begin
aJsonPair := aJSonRecord.Get(i); // JSonPair
aName := aJsonPair.JsonString.ToString; // string var
aVal := aJsonPair.JsonValue; // JSonValue

   ShowMessage( aName + '='+ aVal.ToString); 

end;