comp.lang.ada
 help / color / mirror / Atom feed
From: "mcdoobie" <chainsawtwothousand@nospam.dot.home.dot.com>
Subject: Re: Getting a one-touch option (was: Ada95 tutorials with sample code)
Date: Thu, 08 Mar 2001 18:10:18 GMT
Date: 2001-03-08T18:10:18+00:00	[thread overview]
Message-ID: <eWPp6.37842$W05.7762543@news1.rdc1.mi.home.com> (raw)
In-Reply-To: mailman.983965508.309.comp.lang.ada@ada.eu.org

In article <mailman.983965508.309.comp.lang.ada@ada.eu.org>, "Mario Amado
Alves" <maa@di.fct.unl.pt> wrote:

> Lately I have been using enumerations and exceptions for this kind of
> problem:
> 
>   type Options is (A, V); Option: Options; C: Character;
> begin
>   loop
>     Put("Please enter either a 'V' or an 'A'"); Get_Immediate(C); begin
>       Option := Options'Value(C & ""); exit;
>     exception
>       when Constraint_Error => null;
>     end;
>   end loop;
> 
> There is of course more to be said about "exception-oriented"
> programming.  Let us save that for the Ada-Europe'2001 workshop ;-)

The whole use of types in Ada has kinda got me confused.

For example...

	the_volume := find_volume( aLength, aWidth, aHeight);

Gives me the error message on compile ...

	"array type required in indexed component"

This is NOT an array, it's a function call.

Heh, I guess I'll be hitting the books again.

Exceptions are something I plan on playing with soon. As soon as I got
all the basics worked out.

McDoobie

Thanks.



  reply	other threads:[~2001-03-08 18:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <B6A1A9B09E52D31183ED00A0C9E0888C469A44@nctswashxchg.nctswash.navy.mil>
2001-03-07 11:50 ` Getting a one-touch option (was: Ada95 tutorials with sample code) Mario Amado Alves
2001-03-08 18:10   ` mcdoobie [this message]
2001-03-08 18:49     ` Marin David Condic
2001-03-08 19:21     ` tmoran
replies disabled

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