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,ab132517972acd5f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!130.59.10.21.MISMATCH!kanaga.switch.ch!news-zh.switch.ch!switch.ch!news.hispeed.ch!linux2.krischik.com!news From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: accessing record element (question to the pros) Date: Fri, 24 Feb 2006 19:32:36 +0100 Organization: Cablecom Newsserver Message-ID: <1704363.KA6FmlD55X@linux1.krischik.com> References: NNTP-Posting-Host: 84-74-134-212.dclient.hispeed.ch Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.hispeed.ch 1140809445 5180 84.74.134.212 (24 Feb 2006 19:30:45 GMT) X-Complaints-To: news@hispeed.ch NNTP-Posting-Date: Fri, 24 Feb 2006 19:30:45 +0000 (UTC) User-Agent: KNode/0.10.1 Xref: g2news1.google.com comp.lang.ada:3145 Date: 2006-02-24T19:32:36+01:00 List-Id: Norbert Caspari wrote: > n this example I try to > build a Union Record, where I can access a single Byte either as a small > positive Integer value or as single Bits. In Pascal you needed this construct but Ada has Unchecked_Conversion to perform this task. In Ada a variant record is checked for consistency and you can't do it because its inconsistence. Suggested readings: http://en.wikibooks.org/wiki/Ada_Programming/Subtypes#Converting_data http://en.wikibooks.org/wiki/Ada_Programming/Types/record#Variant_record And if you still want to do it: The newest GNAT has pragma Unchecked_Union. You find a description in the texts above. Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com