Ada Programming/Attributes/'Position


Ada. Time-tested, safe and secure.

DescriptionEdit

'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.

ExampleEdit

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 alsoEdit

WikibookEdit

Ada Reference ManualEdit