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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost2.xs4all.net!news.kpn.nl!not-for-mail From: "ldries46" Newsgroups: comp.lang.ada References: <579615c5$0$20671$e4fe514c@news.kpn.nl> In-Reply-To: <579615c5$0$20671$e4fe514c@news.kpn.nl> Subject: Re: Using Access Types for a simple solution Date: Mon, 25 Jul 2016 17:27:58 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 Message-ID: <57963014$0$20650$e4fe514c@news.kpn.nl> NNTP-Posting-Host: 77.168.179.107 X-Trace: 1469460500 dreader33.news.xs4all.nl 20650 77.168.179.107:57389 X-Complaints-To: abuse@kpn.nl Xref: news.eternal-september.org comp.lang.ada:31158 Date: 2016-07-25T17:27:58+02:00 List-Id: Thanks Dimitri, I did not realise that the aliased not before the array comes but before the box. The suggestion you did I tried before but the code became to complicated to be still readable. May be this not the best way to tackle my problem but is is better readable and therefore better maintainable L. Dries "ldries46" schreef in bericht news:579615c5$0$20671$e4fe514c@news.kpn.nl... Let me first explain the problem. I do have a matrix of records type Box is record ... ... end record Grid : array( 1 .. N, 1 .. M) of Box; Now I must do something with a random set out of elements from the matrix. I would like to create an array of pointers to the elements of the matrix so that I can use these elements and file the changes directly if the array. So I created a type: type Box_Access is access all Box; and make an array Box_Array : array(1 .. Q) of Box_Acess; When try to use that in a simple statement Box_Array(n) := Grid(n1, n2)'Access; I get the error (only for this statement): prefix of 'Access attribute must be aliased. I tried: Grid : aliased array( 1 .. N, 1 .. M) of Box; But that also gives the same error. I cannot imagine that what I want is not possible in Ada as I can realise it in C++ so I do miss something. L. Dries