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=3.3 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_REPLYTO,HK_RANDOM_FROM,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC,WEIRD_PORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dfe1c08e956f971a X-Google-Attributes: gid103376,public From: DPH Subject: Re: Reading a text file Date: 2000/10/06 Message-ID: <39DDEE76.E4AA4EB1@kg.hsanet.net>#1/1 X-Deja-AN: 678968717 Content-Transfer-Encoding: 7bit References: X-Accept-Language: en,pdf Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsabuse@supernews.com Organization: Posted via Supernews, http://www.supernews.com MIME-Version: 1.0 Reply-To: rally2xs@compuserve.com Newsgroups: comp.lang.ada Date: 2000-10-06T00:00:00+00:00 List-Id: Note that the procedure "Read" is not a part of Ada.Text_IO. That is why it is not visible. You probably want the procedure "Get" which is in Ada.Text_IO. All the details are in A.10.1 of the Ada 95 Reference Manual. Dave Head stiletto@ryuji.net wrote: > Hello All! > > How can I read text file? Following program is supposed to read a text > file and print out the contents of the file, but I got following error > messages. > > Thanks in advance > > test.adb:13:01: "Read" is not visible > test.adb:13:01: non-visible (private) declaration at a-textio.ads:348 > test.adb:13:01: non-visible declaration at a-stream.ads:58 > gnatmake: "test.adb" compilation error > > with Ada.Text_IO; > use Ada.Text_IO; > > procedure test is > Data_File : File_Type; > Result_File : File_Type; > St : String(1..100); > begin > > Open(Data_File, In_File, "infile"); > > while not End_Of_File(Data_File) loop > Read(Data_File, St); > Put_Line(St); > end loop; > > end test;