From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.140.233.84 with SMTP id e81mr19591891qhc.2.1426252513339; Fri, 13 Mar 2015 06:15:13 -0700 (PDT) X-Received: by 10.140.91.10 with SMTP id y10mr751008qgd.39.1426252513294; Fri, 13 Mar 2015 06:15:13 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!hl2no11341565igb.0!news-out.google.com!db6ni50316igc.0!nntp.google.com!hl2no11341564igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 13 Mar 2015 06:15:13 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=5.81.80.126; posting-account=28F2IwkAAACL1Z5nRC-dE7zuvWdbWC7P NNTP-Posting-Host: 5.81.80.126 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: JSON and interpreting JSON objects From: tonyg Injection-Date: Fri, 13 Mar 2015 13:15:13 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:25161 Date: 2015-03-13T06:15:13-07:00 List-Id: I'm playing with some JSON. I am trying to pick some information out of a JSON object but am trying to understand what I am doing first. In the following code I am not totally sure about displaying a JSON object, and I was wondering what to put in "when JSON_Object_Type =>" I want to traverse over the object and print the information out if you didn't manage to guess what I was trying to do CODE>>> with GNATCOLL.JSON; use GNATCOLL.JSON; procedure Output_Json (JV : in Json_Value) is begin case Kind(Val => JV) is when JSON_Array_Type => for count in 1..JV.Length loop Output_Json (JV.Get(count)); end loop; when JSON_Object_Type => when JSON_Null_Type => TP.Put_Line("JSON_NULL_TYPE"); when others => TP.Put_Line(JV.Get'Image); end case; end Json_Stuff;