comp.lang.ada
 help / color / mirror / Atom feed
From: winn@ist.flinders.edu.au (Tiffany Rose Winn)
Subject: Ada95 input output - simple question from novice
Date: 1996/03/25
Date: 1996-03-25T00:00:00+00:00	[thread overview]
Message-ID: <4j6551$pem@baggins.cc.flinders.edu.au> (raw)


I want to use a simple put statement to display an integer in 
a minimum number of spaces: for example,

    count: integer:= 5;
    put(count, 2);

I thought the above statement would display the integer variable
count in a minimum of two spaces, but I keep getting an error saying
that my second put parameter is invalid.  

My guess is that this may be because the Ada compiler is using the 
put for characters, so I tried adding the line 
    package Ada.Integer_Text_IO is new Ada.Text_IO.Integer_IO(Integer);
just after the declaration of my main procedure, and also changed
the relevant put statement to
    Ada.Integer_Text_IO.put(count, 2);  
This gave me the following error:
    child unit allowed only at library level

I'm stuck as to where to go next (moving the package declaration to just 
below the "with Text_IO" line gave me errors, too).

Can anyone help?

Thanks in advance for your time.

-- 
Tiffany 
winn@cs.flinders.edu.au






             reply	other threads:[~1996-03-25  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-03-25  0:00 Tiffany Rose Winn [this message]
1996-03-24  0:00 ` Ada95 input output - simple question from novice Robert Dewar
1996-03-25  0:00   ` Keith Thompson
1996-03-25  0:00 ` Tore Joergensen
replies disabled

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