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,9dab60b03456eeec X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-09-24 15:01:38 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!MathWorks.Com!yeshua.marcam.com!uunet!gwu.edu!gwu.edu!not-for-mail From: mfeldman@seas.gwu.edu (Michael Feldman) Newsgroups: comp.lang.ada Subject: Re: Help on ada programming! Date: 24 Sep 1994 17:43:35 -0400 Organization: George Washington University Message-ID: <3626i7$8lg@felix.seas.gwu.edu> References: NNTP-Posting-Host: 128.164.9.3 Date: 1994-09-24T17:43:35-04:00 List-Id: In article , Bob Duff wrote: >In article , >Peter Miller wrote: >>I am not familiar with ada and have to do a class assigment in the language. >>Does ada have a way to peek ahead in the input stream or get and put back >>characters from an input stream. >> >>Anyone who could reply I would really appricaiate it. > >Ada 83 does not have any standard way to do that, but your vendor might >provide an extension to do it. Well, it depends on whether you _really_ have to look ahead in the input stream. There are certainly operations in Ada 83 Text_IO to: - read an entire line into a string, which you can use as your own "input buffer" (Get_Line(....)) - parse/convert numeric or enumeration tokens from a string (or string slice) just as you can from the _real_ input stream (Get(S,...)) - move around in the string, so you can directly control the "input pointer", looking forward or back as the case requires. Take a look at the full specification for Text_IO. The LRM and most textbooks provide it; in the textbook case, usually in an appendix. You may be unaware of the "goodies" there. Are you sure this isn't what your instructor meant? 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) NOTE NEW PHONE NUMBER. "Pork is all that stuff the government gives the other guys." ------------------------------------------------------------------------