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=0.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FREEMAIL_REPLYTO,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7f7e3d24b1fe22fd,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-11-24 15:42:18 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!b0b69.pppool.DE!not-for-mail From: "Mika Fischer" Newsgroups: comp.lang.ada Subject: End_Of_File does not work as expected... Date: Sat, 25 Nov 2000 00:42:19 +0100 Message-ID: Reply-To: mika_fischer@gmx.de NNTP-Posting-Host: b0b69.pppool.de (213.7.11.105) X-Trace: fu-berlin.de 975109336 5226259 213.7.11.105 (16 [28816]) User-Agent: Pan/0.9.1 (Unix) X-No-Productlinks: Yes Xref: supernews.google.com comp.lang.ada:2406 Date: 2000-11-25T00:42:19+01:00 List-Id: Hi! I have a problem with a program I had to write for university. The program is supposed to read its standard input and write it onto its standard output. Why does the following code not work as expected? procedure Echo is c: Character; begin while not End_Of_File loop Get(c); Put(c); end loop; end Echo; When I compile it and invoke it like in "cat file | ./echo" it throws the exception END_ERROR which indicates that I tried to read from a file beyond the end of file. So why is End_Of_File false when it should be true? Also if I invoke the program as "./echo" and type for example "ddd" and press the enter key, the following appears on my screen: ---- ddd ddd ---- When I press Enter once more its this: ---- ddd ddd ---- I also don't understand why it behaves as it does. I'm using GNAT 3.13p-2 on Debian GNU/Linux (woody) and Linux 2.4.0-test10. As you have certainly noticed I don't really have a clue about Ada. So my apollogies if this question ist just too stupid :-) (And sorry for my English...) Thanks for any answers! Mika