Enumerated types define ordered sets of values by enumerating the identifiers that denote these values. Their ordering follows the sequence in which the identifiers are enumerated.
name = (identifier,
Thein the type definition become constants of the enumerated type.
The first constant has an ordinality of 0, the second has an ordinality of 1, the third an ordinality of 2, and so on.
Enumerated types are a subclass of thetypes.
Suit = (Club, Diamond, Heart, Spade);
Given this declaration, Heart is a constant of type Suit.
Thestandard function returns the ordinality of an enumerated constant. In this example,
Ord(Club) = 0
Ord(Diamond) = 1
Ord(Heart) = 2
and so on.