Ada Programming/Attributes/'Position

From Wikibooks, open books for an open world
Jump to: navigation, search

Ada Lovelace 1838.jpg

Description[edit]

'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[edit]

If you declare:

type My_Record is
   record
      Component1 : Integer;
      Component2 : Integer;
   end record;

then

My_Record.Component2'Position = 1

This assumes an integer occupies one storage unit.

See also[edit]

Wikibook[edit]

Ada Reference Manual[edit]