comp.lang.ada
 help / color / mirror / Atom feed
From: "Mark Lundquist" <mlundquist2@attbi.com>
Subject: Re: Error checking for type incompatibility
Date: Tue, 11 Dec 2001 00:49:03 GMT
Date: 2001-12-11T00:49:03+00:00	[thread overview]
Message-ID: <3KcR7.27737$wL4.70194@rwcrnsc51> (raw)
In-Reply-To: bf8dbe70.0112101628.1092b75a@posting.google.com


"Ben" <cptnben@gisco.net> wrote in message
news:bf8dbe70.0112101628.1092b75a@posting.google.com...
> Hi,
> I am new to Ada. I decided I would try to learn a new language and Ada
> seemed like a fun project.

cool :-)

> I got a few books, and one of them has
> challenge problem where I am supposed to do some error checking on
> input. This includes checking to make sure that the input type is
> correct. More specifically: the program is supposed to accept only
> integer values. So I need to be able to have an error handler that
> will recognize if someone tries to enter a noninteger value and ask
> them to re-enter a correct value. Since this is a "challenge problem"
> they are not giving me alot to work on here. I checked another book,
> and it had some examples on error handling, but not at the level I
> need. And neither book had any example code that was helpful.
> Remember, I'm new to Ada (from the C++ world) so packages are new to
> me. What do I need folks. Your help is greatly appreciated.
>
> Thanks,
> Ben

Let me ask you this: how would you do this in C++?  ( I don't mean that
rhetorically; I can imagine different approaches to this, and I'm wondering
which one seems right to you).  What is your unit of input, e.g. do they
enter a complete expression on a line, or just one token, or what?  How are
you doing your tokenization?

-- mark






  reply	other threads:[~2001-12-11  0:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-11  0:28 Error checking for type incompatibility Ben
2001-12-11  0:49 ` Mark Lundquist [this message]
2001-12-11  7:35 ` Preben Randhol
2001-12-11 16:31 ` Jerry Petrey
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox