Defining enumerations

An enumeration is a set of related values. It has a name and one or more members (the maximum is 999) associated with it. The members may have values assigned to them, or you can let the compiler assign them. An enumeration defined in the repository can be referenced by a field or template definition, .INCLUDEd in a source file, or referenced by the Synergy Method Catalog for use with xfServerPlus and xfNetLink.

To display the Enumeration Definitions list, select Modify > Enumerations. For each enumeration, the unique enumeration name and a description are displayed. The total number of enumerations in your repository is displayed at the bottom of the list. (See figure 1.)

1. The Enumeration List

Defining a new enumeration and its members

You can define a new enumeration from scratch or by copying and modifying an existing enumeration. If enumeration definitions already exist, new definitions are inserted below the highlighted entry.

1. From the Enumeration Definitions list,

The Enumeration Definition input window is displayed. (See figure 2.)

2. Enter or modify data in each field as instructed below.

Enumeration name

Enter a unique name for the enumeration. The enumeration name can have a maximum of 30 characters and must begin with a letter. The remaining characters can be letters, digits, underscores (_), or dollar signs ($).

Description

Enter a description for the enumeration, with a maximum of 40 characters. This description displays on the Enumeration Definitions list.

2. Defining an enumeration.

3. Select Member Functions > Add Member to display the Member Definition dialog. Enter or modify data in each field as instructed below:

Member name

Enter a name for the member. The name must be unique within the enumeration. The member name can have a maximum of 30 characters and must begin with a letterH. The remaining characters can be letters, digits, underscores (_), or dollar signs ($).

Value

(optional) Enter a numeric value for the member. The value is optional; if not supplied, it will be computed at compile time following the rules documented in ENUM.

4. Exit the Member Definition window to save the member and return to the Enumeration Definition window.
5. Add more members as necessary. New members are added below the member that is selected when you choose the Add function; if you need to reorder members, see Reordering enumeration members .
6. When you’re done adding members, exit the Enumeration Definition window to save your work.

Assigning a long description to an enumeration

You can assign an 1,800‑character description to each enumeration. This enables you to store more detailed information about the enumeration and its use.

1. In the Enumeration Definitions list, highlight the enumeration to which you want to assign a long description.
2. Select Enumeration Functions > Edit Long Description.
3. Enter a long description.
4. Exit the window to save your changes.

Modifying an enumeration and its members

1. Highlight the enumeration in the Enumeration Definitions list and press enter.
2. Modify the description if desired; the enumeration name cannot be modified.
3. When you are done making modifications, exit the Enumeration Definitions window to save your changes.

Reordering enumeration members

1. Highlight the enumeration member you want to move.
2. Select Member Functions > Reorder Members. The highlighted member is enclosed in square brackets ([ ]).
3. Use the up and down arrow keys to move the bracketed member to another location in the list.
4. Select Reorder Members again to exit move mode.

Deleting an enumeration

An enumeration that is referenced by a field or template cannot be deleted.

1. Highlight the enumeration in the Enumeration Definitions list.
2. Select Enumeration Functions > Delete Enumeration.
3. At the prompt, select Yes to delete the enumeration or No to cancel the deletion.