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-Thread: a07f3367d7,4fbc7359e3ccba18 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!z19g2000vbz.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Re: BASIC_NUM_IO Date: Mon, 1 Jun 2009 01:18:09 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <78hfulF1m321pU2@mid.individual.net> NNTP-Posting-Host: 20.133.0.8 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1243844289 11361 127.0.0.1 (1 Jun 2009 08:18:09 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 1 Jun 2009 08:18:09 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z19g2000vbz.googlegroups.com; posting-host=20.133.0.8; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.11) Gecko/2009051909 Firefox/3.0.11,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6155 Date: 2009-06-01T01:18:09-07:00 List-Id: On Jun 1, 8:57=A0am, Georg wrote: > Hi All, > > in my Ada books I find the with-clause "with BASIC_NUM_IO; use > BASIC_NUM_IO". > > The following program > > with basic_num_io; use basic_num_io; > > procedure test_ranges is > begin > =A0 =A0put_line(short_integer'size); > end test_ranges; > > does not compile because the compiler complaints that the package > "basic_num_io" does not exist. > > Is there a replacement for this package in GNAT? How can I print number > on the screen instead? > > Regards > > Georg You could use Ada.Text_IO.Integer_IO and instantiate it with the type of the data item you want to 'Put_Line'. This gets rather tedious if you more than 2 types! ;-) The alternative is to use 'Image, e.g. with Ada.Text_IO; use Ada.Text_IO; procedure Demo is I : Integer :=3D 42; begin Put_Line (Integer'Image (I)); end Demo; The return type from 'Size if 'universal_integer' and you can't say "universal_integer'Image (...") but luckily enough an "Integer'Image (...)" will work for that. Cheers -- Martin