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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8bb703cc61967d22 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-12-30 12:43:22 PST Path: nntp.gmd.de!newsserver.jvnc.net!yale.edu!noc.near.net!paperboy.wellfleet.com!news-feed-1.peachnet.edu!emory!gatech!howland.reston.ans.net!pipex!uunet!gwu.edu!gwu.edu!not-for-mail From: mfeldman@seas.gwu.edu (Michael Feldman) Newsgroups: comp.lang.ada Subject: Re: GNAT not 'getting' CR or LF? Date: 30 Dec 1994 12:39:28 -0500 Organization: George Washington University Distribution: na Message-ID: <3e1gkg$b8o@felix.seas.gwu.edu> References: <1994Dec29.230538.15695@nmt.edu> NNTP-Posting-Host: 128.164.9.3 Date: 1994-12-30T12:39:28-05:00 List-Id: In article <1994Dec29.230538.15695@nmt.edu>, Smilin' Ron Finkbine wrote: >I am using the gnat system (DOS version) and am writing a >Fortran scanner. I am having a problem with the Text_IO.get >function getting a character. It seems to ignore the carriage >return and linefeed characters. > >What knowledge about gnat am I missing? > Not a GNAT issue. Text_IO.Get is doing exactly what the LRM requires. Quoting from 9XLRM A.10.7: "After skipping any line terminators and any page terminators, reads the next character from the specified input file..." in other words, the procedure is designed to ignore the CRs and LFs. The behavior is the same in Ada 83 and Ada 95. To detect EOL in Ada, it's best and most portable to use the Text_IO.End_Of_Line function, since in Ada EOL is not treated as a character, but as an abstraction. This is Pascal-ish, not C-ish, input behavior. For more details, see the LRM (Ada 83 or 95) or a good textbook description of Text_IO. Hope this helps. Mike Feldman ------------------------------------------------------------------------ Michael B. Feldman - chair, SIGAda Education Working Group Professor, Dept. of Electrical Engineering and Computer Science The George Washington University - Washington, DC 20052 USA 202-994-5919 (voice) - 202-994-0227 (fax) - mfeldman@seas.gwu.edu (Internet) ------------------------------------------------------------------------ Ada on the World-Wide Web: http://lglwww.epfl.ch/Ada/ ------------------------------------------------------------------------ "Illegitimi non carborundum." (Don't let the bastards grind you down.) ------------------------------------------------------------------------