comp.lang.ada
 help / color / mirror / Atom feed
From: griest-tom@cs.yale.edu (Tom Griest)
Subject: Re: Help with gnat IO
Date: 28 Nov 1994 13:13:22 -0500
Date: 1994-11-28T13:13:22-05:00	[thread overview]
Message-ID: <3bd6k2INNmc6@RA.DEPT.CS.YALE.EDU> (raw)
In-Reply-To: 3bces8$500@scratchy.reed.edu

In article <3bces8$500@scratchy.reed.edu> yeung@bagpipe.reed.edu (Woodrow Yeung) writes:
>Hi,
>
>I'm using gnat and am having trouble with the input/output routines.
>First of all, how do I use the INTEGER_IO package?  I get this error
>message:
>file "integer_io.ads" not found
>but I see the INTEGER_IO package defined within the a-textio.ads file.
>I want to be able to format my field width.
>

Is the a-textio.ads file in a directory specified by the ADA_INCLUDE_PATH
environment variable?  BTW, you should always say what host/target and
compiler revision you are working with.

>Secondly, in the Ada reference manual (July 1980) there is a function  
                                        ^^^^^^^^^
>GET_STRING that reads a sequence of character up to the next white space.   

You're kidding right?  You should sell this rev of the Ada manual
to some collector and download the most recent version of the RM from
the ajpo host.  Make sure you get a 9X version.
 
>This function does not exist in the gnat implementation.  I want to do  
>this without writing my own routine.  By using GET, I end up with  
>characters filling my string.  Worse yet, I read too much data.  My data  
>is composed of lines with fields delimited by whitespace.  (I guess  
>GET_STRING got taken out of Ada before it was finalized.)

Good guess.  It is very difficult to assign unconstrained arrays to
an object when you don't know what the size is.  Of course there are
work-arounds (like dynamic allocation or creating a new declarative scope)
and this type of silly function now exists in several places in 9x. :-(

Use procedure: Get_Line(STR,LINE_LEN);


>
>I would appreciate any help.  By the way, where's all the traffic in
>this newsgroup?  Are people still using Ada?
>

Yes.

-Tom



  reply	other threads:[~1994-11-28 18:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-11-28 11:28 Help with gnat IO Woodrow Yeung
1994-11-28 18:13 ` Tom Griest [this message]
1994-11-29 22:05 ` Robert Dewar
1994-12-01  3:10   ` Keith Thompson
1994-12-01 13:34   ` Bob Duff
  -- strict thread matches above, loose matches on Subject: below --
1994-11-29 17:52 Bennett, Chip (KTR) ~U
replies disabled

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