comp.lang.ada
 help / color / mirror / Atom feed
* Ada95 input output - simple question from novice
@ 1996-03-25  0:00 Tiffany Rose Winn
  1996-03-24  0:00 ` Robert Dewar
  1996-03-25  0:00 ` Tore Joergensen
  0 siblings, 2 replies; 4+ messages in thread
From: Tiffany Rose Winn @ 1996-03-25  0:00 UTC (permalink / 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






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1996-03-25  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-03-25  0:00 Ada95 input output - simple question from novice Tiffany Rose Winn
1996-03-24  0:00 ` Robert Dewar
1996-03-25  0:00   ` Keith Thompson
1996-03-25  0:00 ` Tore Joergensen

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