Enumerated Type Expressions

Enum Literals

An enum literal is just the identifier you gave to that particular value. You cannot use the alternative text or numeric values. As the same identifier can exist in more than one enumerated type, literals can only be used where the type is known - such as when assigning to a variable of the correct type. Null can be used as an enum literal provided it appears when a known enum type is expected.

Comparison Operators

The four comparison operators: ">=" greater than or equal; '<=' less than or equal; '>' greater than and '<' less than all work with enumerated types but the scalar value is always determined by the order in which they occur in the type definition ( the user specified numeric values are NOT used ). A particular enum value is greater than the ones that appeared earlier. You can only compare enums of the same type.

Equality Operators

The two equality operators, '==' and '<>', work with enumerated types. If you are comparing against a literal, the literal must be on the right hand side - the left hand side must be an expression the yields a known type.