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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5fa303cecfab07f5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-17 00:38:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeed1.bredband.com!bredband!uio.no!newsfeed.vmunix.org!news-mue1.dfn.de!news-fra1.dfn.de!news0.de.colt.net!blackbush.xlink.net!blackbush.de.kpnqwest.net!npeer.de.kpn-eurorings.net!rz.uni-karlsruhe.de!schlund.de!news.online.de!not-for-mail From: "Dr. Michael Paus" Newsgroups: comp.lang.ada Subject: Re: Get Integer into Enumeration_IO doesn't work Date: Sun, 17 Nov 2002 09:38:10 +0100 Organization: 1&1 Internet AG Message-ID: References: NNTP-Posting-Host: p50830632.dip0.t-ipconnect.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.online.de 1037522291 27688 80.131.6.50 (17 Nov 2002 08:38:11 GMT) X-Complaints-To: abuse@online.de NNTP-Posting-Date: 17 Nov 2002 08:38:11 GMT User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en Xref: archiver1.google.com comp.lang.ada:30993 Date: 2002-11-17T08:38:11+00:00 List-Id: Amir Shaked wrote: > Hello, > > The following code compiles and links > but fails on DATA_ERROR in run-time. > Can you tell me why? > > with Text_IO; > procedure PrintInt > is > Num : Integer; > package EnumIO is new Text_IO.Enumeration_IO(Integer); > begin > Text_IO.Put_Line ("Enter Num:"); > EnumIO.Get (Num); > end PrintInt; If you do not need any specific formatting you can simply write: with Text_IO; procedure PrintInt is Num : Integer := 4711; -- You have to assign some value begin Text_IO.Put_Line ("Enter Num:" & Integer'Image(Num)); end PrintInt; In this case you do not need any instantiations at all. Michael