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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,13fd7bcbabaa9519 X-Google-Attributes: gid103376,public From: ajaskey@gnn.com (Andy Askey) Subject: Re: End of Line Question Date: 1996/07/14 Message-ID: <4s9o6j$ro4@news-e2b.gnn.com>#1/1 X-Deja-AN: 168274054 references: <4s4tn7$po6@masala.cc.uh.edu> x-gnn-newsserver-posting-date: 14 Jul 1996 03:05:55 GMT organization: GNN newsgroups: comp.lang.ada Date: 1996-07-14T00:00:00+00:00 List-Id: cosc19z5@Bayou.UH.EDU (Spasmo) wrote: >Hi. >In Ada95/83 is there any way to test if the end of line has been reached >on the input? I'm still in the process of learning Ada, but I haven't >found any info on that. What I'm trying to do is read characters >one by one (via Ada.Text_IO.Get) and I would like to do so until >CR is pressed. Unfortunately I find that Get ignores CRs entirely >so I can't test what I read. >I know that I could do use Ada.Text_IO.Get_Line, and process the >string, however I would prefer to use Get for this. If Ada95 implements stream like C++ does then you probably out to just go that route. The method I have been using forever is to read an entire line into a string with get_line. I then can parse the string any way I want depending on with wind and barometric pressure. Just make sure your originally string is big enough and you probably want to initialize it to blanks first. package body read_it is str : string(1..1024); -- pick a bigger number if you'd like len : integer; procedure get_it (hfile : text_io.file_type) is begin while not end_of_file(hfile) loop str := (others => ' '); get_line(hfile, str, len); -- use text_io to get numbers and enumerated types -- just grab the characters for text stuff end loop; end; -- May your karma be excellent for forgiving my spelling mishaps. Andy Askey ajaskey@gnn.com