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,FREEMAIL_FROM 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 19:18:42 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: devine@linuxmail.org (devine) Newsgroups: comp.lang.ada Subject: Re: how to read a file into a array??? Date: 4 May 2002 19:18:41 -0700 Organization: http://groups.google.com/ Message-ID: References: <3CD430FE.B803914C@acm.org> <3CD45E7D.2DA637B5@attbi.com> NNTP-Posting-Host: 24.68.22.66 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1020565122 29334 127.0.0.1 (5 May 2002 02:18:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 5 May 2002 02:18:42 GMT Xref: archiver1.google.com comp.lang.ada:23551 Date: 2002-05-05T02:18:42+00:00 List-Id: This is what I have so far: WITH Ada.Text_IO; WITH Ada.Integer_Text_IO; PROCEDURE Test IS FileName : String(1..80); MaxName : CONSTANT Positive := 80; SUBTYPE NameRange IS Positive RANGE 1..MaxName; Length : NameRange; InFile : Ada.Text_IO.File_Type; y: integer; Max : CONSTANT Integer := 999999; SUBTYPE Size IS Integer RANGE 0..Max; TYPE TestArray IS ARRAY (Size) OF Character; X : TestArray; BEGIN Ada.Text_IO.Put (Item => "Enter the name of the file > "); Ada.Text_IO.Get_Line(Item => FileName, Last => Length); Ada.Text_IO.New_Line; Ada.Text_IO.Open(File => InFile, Mode => Ada.Text_IO.In_File, Name => FileName(1..Length)); Y:=0; LOOP EXIT WHEN Ada.Text_IO.End_Of_File(InFile); Y:=Y+1; Ada.Text_IO.Get(File => InFile, Item => X(Y)); Ada.Text_IO.New_Line; END LOOP; Ada.Integer_Text_IO.Put(y); END Test; This is what I was playing around with. How can I change it so that it reads the file and each word is read instead of each character? i put character at the top because i wasn't sure what to put their. I will need something that checks for the whitespace inbetween the words right?