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-Thread: 103376,334ea3c211604808 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!64g2000cwx.googlegroups.com!not-for-mail From: "Adam Beneschan" Newsgroups: comp.lang.ada Subject: Re: Rename Problem Date: 6 Mar 2007 15:21:44 -0800 Organization: http://groups.google.com Message-ID: <1173223304.236348.131180@64g2000cwx.googlegroups.com> References: <1173197839.773371.261080@q40g2000cwq.googlegroups.com> <1173200030.11841.82.camel@localhost> <1173217813.885292.192700@q40g2000cwq.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1173223318 22849 127.0.0.1 (6 Mar 2007 23:21:58 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 6 Mar 2007 23:21:58 +0000 (UTC) In-Reply-To: <1173217813.885292.192700@q40g2000cwq.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: 64g2000cwx.googlegroups.com; posting-host=66.126.103.122; posting-account=cw1zeQwAAABOY2vF_g6V_9cdsyY_wV9w Xref: g2news2.google.com comp.lang.ada:9733 Date: 2007-03-06T15:21:44-08:00 List-Id: On Mar 6, 1:50 pm, "Ant" wrote: > > > If you want to rename a component of msg, msg (1) say, > > then the renamed thing is an object. In this case it is > > of type signals_record. Not easy to tell without seeing > > some more source, preferably compilable. > > > ... : signals_record RENAMES msg (1); > > This test procedure should compile. Sorry for the laziness. > > PROCEDURE test IS > > ------------------------------------------- > GENERIC -- receive message -- > > id : integer; > > TYPE message_type IS PRIVATE; > > PACKAGE transmit_message IS > > PROCEDURE write; > > END transmit_message; > ------------------------------------------- > > ----------------------------------------------------------------------------- > PACKAGE BODY transmit_message IS > > PROCEDURE write IS > BEGIN > null; > END write; > > END transmit_message; > > ----------------------------------------------------------------------------- > > ------------------------------------------- > TYPE signals_record IS > RECORD > data1 : boolean; > data2 : boolean; > END RECORD; > > FOR signals_record USE > RECORD > data1 AT 0 RANGE 0 .. 15; > data2 AT 0 RANGE 16 .. 31; > END RECORD; > ------------------------------------------- > > SUBTYPE msg_count IS integer RANGE 1 .. 4; > TYPE message_array IS ARRAY (msg_count) OF signals_record; > msg : message_array; > > id : integer := 1; > > PACKAGE m1 IS NEW transmit_message (id, signals_record); > > msg (1) : signals RENAMES m1.signals_record; > > END test; That RENAMES is wrong on so many levels, I don't know where to begin. Transmit_Message doesn't declare a "signals_record" so m1.signals_record doesn't exist; "signals_record" is a type, anyway, and you can't rename a type; the identifier "signals" isn't declared and it has no meaning; and you can't use RENAMES to declare an identifier you've already declared (i.e. "msg"), and you can't use RENAMES to declare an array component anyway. I can't tell what you're trying to accomplish. What were you trying to do with this RENAMES declaration? If you can describe that, we can help you write it correctly. If all you're doing is to try to give another name to msg(1), so you can call it something else, such as msg_1, then Georg already gave you the answer: msg_1 : signals_record renames msg(1); -- Adam