Re: accessing record element (question to the pros)
- From: Martin Krischik <krischik@xxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 24 Feb 2006 19:32:36 +0100
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@xxxxxxxxxxxxxxxxxxxxx
Ada programming at: http://ada.krischik.com
.
- Follow-Ups:
- Re: accessing record element (question to the pros)
- From: Matthew Heaney
- Re: accessing record element (question to the pros)
- References:
- accessing record element (question to the pros)
- From: Norbert Caspari
- accessing record element (question to the pros)
- Prev by Date: Re: accessing record element (question to the pros)
- Next by Date: Re: help with include and library files in GPS
- Previous by thread: Re: many thanks to all the people who give me useful hints!
- Next by thread: Re: accessing record element (question to the pros)
- Index(es):