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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4227f66b399d97f5 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!s9g2000prg.googlegroups.com!not-for-mail From: Anh Vo Newsgroups: comp.lang.ada Subject: Re: Help, asking for code to print out an enumerated type Date: Fri, 21 Nov 2008 09:24:02 -0800 (PST) Organization: http://groups.google.com Message-ID: <7f31b71b-f8d0-4721-8abe-aa5075172446@s9g2000prg.googlegroups.com> References: <37008a4c-cdbf-42f4-b806-352501419ff6@n33g2000pri.googlegroups.com> NNTP-Posting-Host: 69.232.230.225 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1227288242 11762 127.0.0.1 (21 Nov 2008 17:24:02 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 21 Nov 2008 17:24:02 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s9g2000prg.googlegroups.com; posting-host=69.232.230.225; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:3706 Date: 2008-11-21T09:24:02-08:00 List-Id: On Nov 21, 8:21=A0am, ChristopherL wrote: > Hello everyone in Ada land, > > Today, I'm looking for someone to post all the code to print out an > enumerated type in Ada 83. Ideally, I would like a small program with > an enumerated variable containing code to print it out. > > Thank you, > Chris This code should work for all Ada including Ada 2005. I hope you get the idea to print any enumerated values. with Text_Io; procedure Print_Enum_Values is I_Prefer_Ada : Boolean :=3D True; -- type Boolean is (True, False); defined in Standard begin Text_Io.Put_Line ("Are you prefer Ada? " & Boolean'Image (I_Prefer_Ada)); end Print_Enum_Values;