From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,177ff20edf7f64cf X-Google-Attributes: gid103376,public From: jsa@organon.com (Jon S Anthony) Subject: Re: Unconstrained array aggregation..sq. peg into round hole? Date: 1996/03/20 Message-ID: #1/1 X-Deja-AN: 143328745 sender: news@organon.com (news) references: <4ihrvo$hs5@dfw.dfw.net> organization: Organon Motives, Inc. newsgroups: comp.lang.ada Date: 1996-03-20T00:00:00+00:00 List-Id: In article <4ihrvo$hs5@dfw.dfw.net> dweller@dfw.net (David Weller) writes: > package Strange is > > type Real_Array is array (Natural range <>) of Float; > > type Real_Table is array (Natural range <>, Natural range <>) of Float; > > MAX : constant := 3; > > Table : constant Real_Table := > ( (20.0, 40.0, 80.0), > (20.0, 40.0, 80.0), > (20.0, 40.0, 80.0), > (20.0, 40.0, 80.0), > (60.0, 120.0, 240.0) ); > > An_Array : constant Real_Array; > > private > > An_Array : constant Real_Array := (0..Max-1 => Table(Max)(0..Max-1)); > -- incorrect # of indices? > > end Strange; Table is a 2 dimensional array with float components. The error line shows an attempt to only specify one index of the two required. Two dimensional arrays do not have Pascal array of array semantics. You have to write that if it is what you want. Of course here, you can't quite do that because you can't have an indefinite type be a component of an array (the potential Real_Array part). The typical trick is to use an array of pointers to unconstrained array type. see 3.6(10, 12, 13) /Jon -- Jon Anthony Organon Motives, Inc. 1 Williston Road, Suite 4 Belmont, MA 02178 617.484.3383 jsa@organon.com