comp.lang.ada
 help / color / mirror / Atom feed
From: Claude SIMON <claude.simon@setra.fr>
Subject: Re: record question
Date: Fri, 26 Oct 2001 15:42:28 +0200
Date: 2001-10-26T13:39:59+00:00	[thread overview]
Message-ID: <3BD96844.699A15BC@setra.fr> (raw)
In-Reply-To: 3BD9618C.D154FE0C@icn.siemens.de

I think
y := (i => 99);

is better : (99) is an integer expression, not an array nor a record
aggregate.
The same problem arise when you want to pass an array of one element, you
must
write (1=> X).

Claude Simon


Alfred Hilscher a �crit :

> Hi,
>
> assume that I have a record like the one below. I can assign aggregates
> in the case that I have subcomponents, but how do I assign if I don't
> have?
>
> procedure RT is
>   type x (i : Integer := 0) is
>     record
>       case i is
>         when 0 => null;
>         when 1..10 => s : STRING (1..10);
>         when others => null;
>       end case;
>     end record;
>
>   y : x;
> begin
>   y := (1, "ABC       ");  -- this is OK
>
>   y := (99);   -- but, how do that ?
>
>   y.i := 99;   -- do not work either, so how assign a value different to
> 1..10 ?
> end RT;




  parent reply	other threads:[~2001-10-26 13:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-26 13:13 record question Alfred Hilscher
2001-10-26 13:33 ` Petter Fryklund
2001-10-26 14:59   ` Ted Dennison
2001-10-26 13:42 ` Claude SIMON [this message]
2001-10-26 15:01   ` Ted Dennison
2001-10-26 15:50     ` Claude SIMON
2001-10-26 21:22 ` Richard Pinkall-Pollei
2001-10-26 23:54 ` Jeffrey Carter
replies disabled

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