comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Re: BASIC_NUM_IO
Date: Mon, 01 Jun 2009 08:18:28 GMT
Date: 2009-06-01T08:18:28+00:00	[thread overview]
Message-ID: <o9MUl.43434$d36.13657@bgtnsc04-news.ops.worldnet.att.net> (raw)
In-Reply-To: 78hfulF1m321pU2@mid.individual.net

"Ada.Integer_Text_IO" is the standard package that most use for integer I/O

with Ada.Text_IO ;   -- use for "new_line" 
use  Ada.Text_IO ;

with Ada.Integer_Text_IO ; -- use for integer "put" 
use  Ada.Integer_Text_IO ;

procedure test_ranges is
begin
  put ( short_integer'size ) ;
  new_line ;
end test_ranges ;


If you want to define your own type of integer  then 

with Ada.Text_IO ;   -- use for new_line 
use  Ada.Text_IO ;

procedure test_ranges is

  package basic_num_io is new Ada.Text_IO.Integer_IO ( Integer ) ;
  use basic_num_io ; 

begin
  put ( short_integer'size ) ;
  new_line ;
end test_ranges ;

In <78hfulF1m321pU2@mid.individual.net>, Georg <nobody@nowhere.com> writes:
>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
>   put_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




      parent reply	other threads:[~2009-06-01  8:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-01  7:57 BASIC_NUM_IO Georg
2009-06-01  8:13 ` BASIC_NUM_IO Pascal Obry
2009-06-01  8:18 ` BASIC_NUM_IO Martin
2009-06-01  8:18 ` anon [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox