J
jens
Guest
On Jun 12 2002, 5:51 pm, b...@altavista.com (Bill Austin) wrote:
It looks like this will do the trick:
OBJ0 : A := (1 to 0 => 0); -- invalid range results in null array
However I was hoping to find something that doesn't look like a
kludge. Any ideas?
I'm trying to do the same thing with a default value for a generic.Let A be an unconstrained array, e.g.
TYPE A is array(natural range <> or integer.
Consider creating objects of type A and initializing them via
aggregates:
OBJ2 : A := (3, 7); -- Creates a two-element object
-- with A(0)=3 and A(1)=7.
OBJ1 : A := (0 => 3); -- Creates a one-element object
-- with A(0)=3.
--(Named association required,
-- see e.g. the VHLD FAQ)
OBJ0 : A := ? -- how can OBJ0 be initialized
-- to anull array?
The aggregate syntax (LRM 7.3.2) does not appear to allow for
initialization using an aggregate. Can someone confirm this? Anybody
have a suggestion for initializing OBJ0 to anull array?
It looks like this will do the trick:
OBJ0 : A := (1 to 0 => 0); -- invalid range results in null array
However I was hoping to find something that doesn't look like a
kludge. Any ideas?