comp.lang.ada
 help / color / mirror / Atom feed
From: steveo <steve@notospam.com>
Subject: Re: What is happening Here?Totally clueless
Date: Tue, 19 Aug 2003 14:36:53 GMT
Date: 2003-08-19T14:36:53+00:00	[thread overview]
Message-ID: <9Cq0b.474$nA5.106926@dca1-nnrp1.news.algx.net> (raw)
In-Reply-To: <d40d7104.0308190522.4b631227@posting.google.com>

prashna wrote:

> Hi all,
> Have a look at the following program,
> with text_io;
> use text_io;
> procedure TEST is 
> type array_unconstrained is array(integer range <>) of integer;
> subtype array_local is array_unconstrained(1..10);
> array1 : array_local;
> begin
> 
>    array1 := (others => 0);
>    array1(1..2) := array_local'(others => (2));

Warning: line 10 col 20 LRM:11.5(15), Static index lengths do not match
Constraint_Error will be raised

Warning: line 10 col 20 LRM:11.5(9), Length check will fail at run-time,
exception will be raised

>                        ^^^^ can anybody what exactly is this?why they
> are not assigning directly to 2 without doing this(Typecast????)
>    put_line(Integer'image(array1(2)));
>    put_line(Integer'image(array1(3)));
> end TEST;
> 
> When I execute a constraint error is being raised.Can any body explain
> what is going on here.
> Thanks in advance,




  reply	other threads:[~2003-08-19 14:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-19 13:22 What is happening Here?Totally clueless prashna
2003-08-19 14:36 ` steveo [this message]
2003-08-19 15:06 ` Nick Roberts
2003-08-20  8:34   ` prashna
2003-08-20 20:45     ` Simon Wright
2003-08-20 22:00       ` chris
replies disabled

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