From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fbb7003b9d2e8c21 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-04 12:05:48 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!netnews.com!xfer02.netnews.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3CD430FE.B803914C@acm.org> From: Jeffrey Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: how to read a file into a array??? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 04 May 2002 19:05:48 GMT NNTP-Posting-Host: 63.184.18.127 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1020539148 63.184.18.127 (Sat, 04 May 2002 12:05:48 PDT) NNTP-Posting-Date: Sat, 04 May 2002 12:05:48 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:23546 Date: 2002-05-04T19:05:48+00:00 List-Id: 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