Go to the first, previous, next, last section, table of contents.
INTEGER | CARDINAL | BOOLEAN | CHAR (* Built-in *)
"{" <id>"," <id>"," ... "}" ";" (* Enumerated types *)
"[" <lo>..<hi> "]" ";" (* Subrange types *)
Ordinal types denote sets of values in which each value has a
unique successor.
- INTEGER
- The set of 32-bit signed integers (positive and negative).
- CARDINAL
- A synonym for the subrange [0..LAST(INTEGER)]
- BOOLEAN
- The enumeration {FALSE, TRUE}
- CHAR
- The set of ISO-Latin-1 characters (an extension of ASCII)
- Enumerated
- An enumerated type is an ordered set of values whose names are specified
by the user, as follows:
TYPE Day = {Sunday, Monday, Tuesday, Wednesday, Thursday,
Friday, Saturday};
Values of an enumeration are specified as <typename>.<value>: for
example, Day.Sunday
rather than just Sunday
. Thus, you
should keep enumeration type names short.
- Subrange
- A subrange is a subset of the values of the base type specified by the
range <lo>..<hi>. <lo> and <hi> must both be values of the same ordinal type.
Integer subranges are the most common:
TYPE Digit = [0 .. 9]; (* subrange of INTEGER *)
WeekDay = [Day.Monday .. Day.Friday]; (* subrange of Day *)
Go to the first, previous, next, last section, table of contents.