comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: how to read a file into a array???
Date: Sat, 04 May 2002 19:05:48 GMT
Date: 2002-05-04T19:05:48+00:00	[thread overview]
Message-ID: <3CD430FE.B803914C@acm.org> (raw)
In-Reply-To: e6a474c.0205041035.7d932b2a@posting.google.com

devine wrote:
> 
> I'm having some problems reading a file into a array.  Say the file
> has the line
> This is a test, how can i read each word of the file into a array? an
> example would be helpful.
> thanks.

An array object in Ada is always a fixed size, so you have to have some
means of deciding how big to make your array. Since words in a text file
are different sizes, you're going to have to have array components that
can handle different size components.

Then there's the definition of a "word" in a text file. Many definitions
are possible. For example, is punctuation part of a word? One definition
of "word" is used by PragmARC.Word_Input (available from

http://home.earthlink.net/~jrcarter010/pragmarc.htm

and the mirror at www.adapower.com).

Until you have dealt with these, it's difficult to be more helpful.

-- 
Jeff Carter
"Nobody expects the Spanish Inquisition!"
Monty Python's Flying Circus



  reply	other threads:[~2002-05-04 19:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-04 18:35 how to read a file into a array??? devine
2002-05-04 19:05 ` Jeffrey Carter [this message]
2002-05-04 22:24   ` Mark Biggar
2002-05-05  2:18     ` devine
2002-05-05  3:52       ` Dale Stanbrough
2002-05-17  8:50       ` GNU Readline ? Sylvain NAHAS
2002-05-17 10:25         ` Adrian Knoth
2002-05-17 19:21           ` Thomas Dickey
2002-05-05  6:20     ` how to read a file into a array??? Simon Wright
replies disabled

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