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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7877c32d98afb317 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-02-08 17:47:10 PST Path: swrinde!howland.reston.ans.net!spool.mu.edu!olivea!nntp-hub.barrnet.net!rational.com!puppy.rational.com!kdm From: kdm@rational.com (Kent Mitchell) Newsgroups: comp.lang.ada Subject: Re: Qu: 3D unconstrained arrays Date: 9 Feb 1995 01:40:43 GMT Organization: Rational Software Corporation Message-ID: <3hbrqr$p7p@rational.rational.com> References: NNTP-Posting-Host: puppy.rational.com X-Newsreader: TIN [version 1.2 PL2] Date: 1995-02-09T01:40:43+00:00 List-Id: Randy Binnie (randyb@ssd.fsi.com) wrote: : Hi, Assuming this news group allows non political postings, I have an : Ada implementation question??? We always accept non-political postings. In fact we prefer them but some times .... : How can one create a 3 dimensional unconstrained array made up of a one : dimensional unconstrained array and a two dimensional unconstrained array. : Ideally I would like to do the following, but it is not allowed because the : type ARRAY_2D_TYPE is unconstrained. : type ARRAY_2D_TYPE is array ( range <>, range <>) of DATA_TYPE; : type ARRAY_3D_TYPE is array ( range <>) of ARRAY_2D_TYPE; This exact structure is not possible so you can't create what you describe above (a two dimensional unconstrained array containing a one dimensional unconstrained array). However, see below to create what you want as you cleaner solution. : but I would prefer a cleaner solution using a single monolithic 3 dimensional : data structure. So my question is can it be done, if so a brief explaination : would be appreciated. This is for an Ada '83 compiler. A monolithic 3d array is declared as: type Array_3D_Type is array (Positive range <>, Positive range <>, Positive range <>) of Data_Type; Note: I had to add a type for the range <>. I picked positive but any discrete type will do. -- Kent Mitchell | One possible reason that things aren't Technical Consultant | going according to plan is ..... Rational Software Corporation | that there never *was* a plan!