From: mfeldman@seas.gwu.edu (Michael Feldman)
Subject: Re: Help on ada programming!
Date: 24 Sep 1994 17:43:35 -0400
Date: 1994-09-24T17:43:35-04:00 [thread overview]
Message-ID: <3626i7$8lg@felix.seas.gwu.edu> (raw)
In-Reply-To: CwnJJy.J3x@inmet.camb.inmet.com
In article <CwnJJy.J3x@inmet.camb.inmet.com>,
Bob Duff <bobduff@dsd.camb.inmet.com> wrote:
>In article <millerpe.780422093@spot.colorado.edu>,
>Peter Miller <millerpe@spot.Colorado.EDU> 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."
------------------------------------------------------------------------
next prev parent reply other threads:[~1994-09-24 21:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <millerpe.780422093@spot.colorado.edu>
1994-09-24 20:57 ` Help on ada programming! Bob Duff
1994-09-24 21:43 ` Michael Feldman [this message]
1994-09-27 4:21 ` Sean McNeil
1994-09-24 15:54 Peter Miller
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox