Hide Comments

An Enumeration Constant specifies a uniquely named value within an Enumeration.  The value may be defined explicitly, or derived implicitly from the name or ordinal position of the Enumeration Constant.  (See the discussion for a full explanation.)

Syntax

<enumeration-constant-name> [: (<int-value> | "<string-value>")]

Examples

See the Examples section of the Enumeration topic.

Parameters

Field Name

Type

Description

<enumeration-constant-name>

Name

The Name assigned to the Enumeration Constant, which MUST be unique within the containing Enumeration.  Conventionally in UPPER_UNDERSCORE style.

<int-value>

Integer Value

An integer value, which MAY be assigned to the Enumeration Constant if the containing Enumeration is of integer type.  In the absence of an explicitly assigned value, the Enumeration Constant is assigned an implicit value equal to its zero-based ordinal position within the containing Enumeration.

<string-value>

String Value

A string value, which MAY be assigned to the Enumeration Constant if the containing Enumeration is of string type.  In the absence of an explicitly assigned value, the Enumeration Constant's name is implicitly assigned as the value.

Child Elements

None.

Parent Elements

Enumeration

Discussion

Default Values

Conformant tools MUST apply default values to Enumeration constants not having explicitly defined values, according to the rules specified in Parameters, above.  A single Enumeration may have Enumeration Constants with a combination of implicit default values and explicitly assigned values.  If an implicitly assigned value duplicates an explicitly assigned value, conformant editors SHOULD warn the user of this condition, which the user may subsequently resolved by assigning an explicit value.

Created with Help & Manual 6 and styled with Premium Pack Version 2.51 © by EC Software