Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 1888

JSON Objects - and getting the names of them

$
0
0

Hello,

A small excerpt from my code is shown below and is part of a nice recursive routine that has worked in the past.

      else if ja.Get(i) is TJSONObject then

      begin

        frmMain.Memo2.Lines.Add('JSONObject - ' + ja.Get(i).Value);

        Indentation(True);

        ParseJSONPairs(ja.Get(i) as TJSONObject);

        Indentation(False);

      end

However, I want to get the name of the object in the following JSON

You'll see that the pwr, spd and hrm objects all have a data_available field and I can't get at this programatically.

 

Any ideas?

 

Regards,

 

Andrew.

 

[{"pwr": {"data_available": false}, "firstname": "Cameron", "msg_internal_id": 5, "lastname": "Meyer", "age": 0, "org_id": "105", "sex": "M", "hrm": {"data_available": false}, "nationality": "AUS", "spd": {"data_available": false}, "id": "105", "cad": {"data_available": false}}, {"pwr": {"data_available": false}, "firstname": "Callum", "msg_internal_id": 6, "lastname": "Scotson", "age": 0, "org_id": "106", "sex": "M", "hrm": {"data_available": false}, "nationality": "AUS", "spd": {"data_available": false}, "id": "106", "cad": {"data_available": false}}, {"pwr": {"data_available": false}, "firstname": "Morgan", "msg_internal_id": 7, "lastname": "Kneisky", "age": 0, "org_id": "107", "sex": "M", "hrm": {"data_available": false}, "nationality": "FRA", "spd": {"data_available": false}, "id": "107", "cad": {"data_available": false}}]



Viewing all articles
Browse latest Browse all 1888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>