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=0.3 required=5.0 tests=BAYES_00,STOX_REPLY_TYPE, STOX_REPLY_TYPE_WITHOUT_QUOTES,XPRIO autolearn=no 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!newsfeed9.news.xs4all.nl!nzpost2.xs4all.net!news.kpn.nl!not-for-mail From: "ldries46" Newsgroups: comp.lang.ada Subject: Using Access Types for a simple solution Date: Mon, 25 Jul 2016 15:35:43 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original 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: <579615c5$0$20671$e4fe514c@news.kpn.nl> NNTP-Posting-Host: 77.168.179.107 X-Trace: 1469453765 dreader33.news.xs4all.nl 20671 77.168.179.107:53039 X-Complaints-To: abuse@kpn.nl Xref: news.eternal-september.org comp.lang.ada:31155 Date: 2016-07-25T15:35:43+02:00 List-Id: 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