Contents | Prev | Next | Index


Enumerations

An enumeration is a list of identifiers that denote values. Each value belongs to that list which constitutes a data type. These identifiers are used as manifest constants in the program. Only they, and no other values, belong to that data type. The values are ordered, with the ordering relation being defined by their sequence in the enumeration. The ordinal number of the first value is 0.

enumeration ::= ( enum_list )
enum_list   ::= enum_list , <identifier>
            ::= <identifier>

Examples:

(red, green, blue)

(club, diamond, heart, spade)

(Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday)


Contents | Prev | Next | Index

Canterbury Pascal for JVM  (Last documentation update Sep 02, 2004)
Copyright © 1999-2004 J.Neuhoff - mhccorp.com  . All rights reserved.
Please send any comments or corrections to neuhoff@mhccorp.com