I see at least two errors instantly: (1) the comment says Inetger'Last is
2,147,486,647, but should say 2,147,483,647; (2) since the exception will be
raised in the declarative region of teh declare block (with the exception
handler), it will be propagated immediately out of the block (and the
handler will never receive it).

Keep trying!

--
Nick Roberts


----- Original Message -----
From: "Rick Duley" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Wednesday, November 07, 2001 3:48 AM
Subject: Run-time checking


> Hi teamers,
>
> I was working on a demonstration exercise for students the other day and
> gave myself one heck of a surprise.
> The idea was that I could increment an integer variable past Integer'Last
> and trap the ensuing uproar, doing something useful with it without
crashing
> the program.  Well, ...that was the idea :(
>
> I am using GNAT 3.13p -- is this a problem with the compiler or have I
> misunderstood the purpose of CONSTRAINT_ERROR all these years?  Do I have
to
> do a manual check for run-time errors like this or am I doomed to have my
> jet plane turn upside down when the variable goes from positive to
negative?
> ;)