Ada Programming/Attributes/'Position
< Ada Programming < AttributesComputing » Computer Science » Computer Programming » Ada Programming

Description
'Position is a record type component attribute. It represents the address offset of the component from the beginning of the record. The value returned is represented in storage units, which is machine-specific.
Example
If you declare:
type My_Record is record Component1 : Integer; Component2 : Integer; end record; R : My_Record;
then
R.Component2'Position = 1
This assumes an integer occupies one storage unit.
See also
Wikibook
- Ada Programming
- Ada Programming/Attributes
- Ada Programming/Attributes/'Bit_Order
- Ada Programming/Attributes/'First_Bit
- Ada Programming/Attributes/'Last_Bit
Ada Reference Manual
- 13.3 Operational and Representation Attributes (Annotated)
- Annex K Language-Defined Attributes (Annotated)
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.