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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,499373c5a06cccc1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-17 07:31:26 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!nx02.iad01.newshosting.com!newshosting.com!border1.nntp.ash.giganews.com!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!local1.nntp.sjc.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 17 Feb 2004 09:31:23 -0600 Date: Tue, 17 Feb 2004 10:31:23 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Variant records.. References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.147.77.160 X-Trace: sv3-6VDMRIToDXggexRLUGUmnoXbH3tASp/iUmMrPEZ9otNJwoLz/PKphOyyi49uSI5+9e8ujsO3F/4BUnE!YiQH2hn4gUz7cPiztxs4GW/w3FZnDdFh0Nc3QTbP3vkpj990pNtw/d1k51tB6w== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:5636 Date: 2004-02-17T10:31:23-05:00 List-Id: Ganesh Ramasivan wrote: > Anyways, in the case above, how can I pass a second discriminant. This > is because I need to be able to select a particular command for a > particular radar. One way is: type RADAR_TYPE_CHOICE is (RADAR_A, RADAR_B); type RADAR_COMMAND_CHOICE is (RADAR_STATE, RADAR_MODE, RADAR_DISPLAY_RANGE_SELECT); type RADAR_COMMAND_TYPE (RADAR_TYPE_CHOICE := RADAR_A; RADAR_COMMAND_CHOICE := RADAR_STATE)is record case RADAR_COMMAND_CHOICE is when RADAR_DISPLAY_RANGE_SELECT => < a whole bunch of parameters...> case RADAR_TYPE_CHOICE is when RADAR_A => when RADAR_B => end case; when others => null; end case; end record; But with this approach, you can't have indentically named elements that are of different types or subtypes for Radars A and B. You can of course give those parameters different names. Or you can have: type Radar_A_Display_Range_Select is... type Radar_B_Display_Range_Select is... type RADAR_COMMAND_TYPE (RADAR_TYPE_CHOICE := RADAR_A; RADAR_COMMAND_CHOICE := RADAR_STATE)is record case RADAR_COMMAND_CHOICE is when RADAR_DISPLAY_RANGE_SELECT => case RADAR_TYPE_CHOICE is when RADAR_A => RADAR_A_DISPLAY_RANGE: RADAR_A_DISPLAY_RANGE_SELECT; when RADAR_B => RADAR_B_DISPLAY_RANGE: RADAR_B_DISPLAY_RANGE_SELECT; end case; when others => null; end case; end record; The potential probleme with this approach is the potentially long names for the individual elements. However, if you set the command via an aggregate, that problem goes away. (Unless your software development plan requires named notation for aggregates. ;-) Either style works. Does this answer your question? -- Robert I. Eachus "The war on terror is a different kind of war, waged capture by capture, cell by cell, and victory by victory. Our security is assured by our perseverance and by our sure belief in the success of liberty." -- George W. Bush