Project members: Enum/Set Item

This member defines a single item (enumerator) within the enum or set member. Item members are represented in Composer by following bricks:

Please note, an item member can exist within an enum or set member only.

Add new enum item

To add a new item into an existing enum member, do following:

First switch to the Composer page for the respective enum member you want to add the new item.

Then, in the Gallery window, ensure that the folder Chora is opened.

Look in the folder for the template named Enum or Set Item.

With the mouse, select the template and drag it into the Composer.

Drop the template within the Composer.

Adding a new item to an enum member.

Add new set item

To add a new item into an existing set member, do following:

First switch to the Composer page for the respective set member you want to add the new item.

Then, in the Gallery window, ensure that the folder Chora is opened.

Look in the folder for the template named Enum or Set Item.

With the mouse, select the template and drag it into the Composer.

Drop the template within the Composer.

Adding a new item to a set member.

Please note the limitation of max. 32 item members within a single set member.

Name the item

First ensure, that the enum/set item member is selected.

Press the key F2 or select the menu item EDITRename ....

Enter the new name in the Inspector window.

Set an explicit value for the item

During the code generation, Embedded Wizard associates every item with an individual number. In case of items enclosed within an enum member, this process starts with the value 0 for the first item, 1 for the second, 2 for the third and so far. In case of items enclosed within a set member, this process starts with the value 1 for the first item, 2 for the second, 4 for the third and so far - always power of two values. The numbering is performed strictly according to the order in which the particular items are defined within the enum/set member.

If desired, you can override this automatism and specify in its attribute Default another numeric value to associate with a particular item. Please note, the assignment affects the numbering of all consecutive items. For example, if you have specified the value 1369 for an enum item, the next following item will be associated with the value 1370 unless you have assigned another value to this member too.

Duplicate an existing item

You can create any number of copies of an already existing enum item member. In case of items existing in a set member, max. 32 item members are allowed.

First ensure, that the enum/set item member is selected.

Press the keys CtrlC and CtrlV in succession ...

... or hold the key Ctrl pressed while you drag and drop the selected item member.

Finally rename the just duplicated item member.

Use the item

The name of the item member can be used within Chora expressions to form a literal of the corresponding enumeration data type or set data type.

Delete an item

First ensure, that the enum/set item member is selected.

Press the key DEL or select the menu item EDITDelete.

Attributes of an item

The following table shows the complete list of attributes provided by the enum/set item member:

Attribute name

Short description

Brick

Determines the position and the size of a enum member brick within the Composer window.

Default

Determines the constant integer value to associate with the enum/set item.

Description

Contains the description for the enum member.