Next: , Previous: Character Types, Up: Data Types

6.2.7 Enumerated Types

       enum_type_identifier = (identifier, ..., identifier);

An enumerated type is a a special case of ordinal types and defines a range of elements which are referred to by identifiers. Enumerated types are ordered by occurence in the identifier list. So, they can be used as index types in an array definition, and it is possible to define subranges of them. Since they are ordered, they can be compared to one another. The intrinsic function Ord applied to name_identifier returns the number of occurence in the identifier list (beginning with zero), Pred and Succ return the predecessor and successor of name_identifier. Boolean is a special case of an enumerated type.

See also

Ordinal Types, Array Types, Subrange Types, Ord, Boolean, Char, Pred, Succ.