7. Embedded QUEL for Pascal : Pascal Variables and Data Types : Variable and Type Declarations : Enumeration Type Definition
 
Share this page                  
Enumeration Type Definition
The declaration for an enumeration type definition has the following syntax:
type type_name = ( enum_identifier {, enum_identifier);
Syntax Notes:
1. An enum_identifier must be a legal Pascal identifier beginning with an alphabetic character or underscore.
2. The enum_identifiers are treated as 4-byte integer constant identifiers.
3. The type_name maps to a 1-byte integer if there are fewer than 257 enumerated identifiers. Otherwise, it maps to a 2-byte integer.
4. When an enumerated identifier is used as a value in an EQUEL statement, only the ordinal position of the identifier in the original enumerated list is important. In assigning a value to a variable of enumeration type, EQUEL passes the variable by address and assumes that the value is a legal one for the variable.
The following is an example of an enumeration type definition:
##  type
##    Table_Field_States =
##    (UNDEFINED, NEWROW, UNCHANGED, CHANGED, DELETED);