comp.lang.ada
 help / color / mirror / Atom feed
* What is happening Here?Totally clueless
@ 2003-08-19 13:22 prashna
  2003-08-19 14:36 ` steveo
  2003-08-19 15:06 ` Nick Roberts
  0 siblings, 2 replies; 6+ messages in thread
From: prashna @ 2003-08-19 13:22 UTC (permalink / raw)


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));
                       ^^^^ 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,



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-08-20 22:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-19 13:22 What is happening Here?Totally clueless prashna
2003-08-19 14:36 ` steveo
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

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