Editing the enums in the enum-editor
How to edit an enum-object in the enum-editor:
-
Select the needed elementary →data type from the list next to Type.
This data type is the →base type for the declaration of the enum. -
Optional: Enter an →initial value for the entire declaration, e.g. a →named element or a literal matching the data type.
-
Optional: Enter a comment, description and custom data in the respective fields.
If you need a new line in these fields, press the Enter-key. If you need the code for a newline in a textual editor, please refer to "Which code is required for a newline in a description or comment?". -
How to change a named element that is already listed under Elements:
-
Change the name of a given element by first pointing to the element name and then double-clicking.
Alternative: Select the element and press the F2-key or select the command Rename in the context menu.
Result: A text field opens. Enter the new text and press the Enter-key. To discard the new text, press the ESC-key. -
Assign a value to the element by first pointing to the value of the element and then double-clicking.
Alternative: Select the element and press Ctrl+I or select the command Edit Initial Value in the context menu.
Result: A text field opens. Enter the new value and press the Enter-key. To discard the new value, press the ESC-key.
-
-
How to create a new named element: Select an element and press Ctrl+Shift and the +-key.
Alternative: Select the command Add New Element in the context menu.
Result: A new element is inserted at the end of the list based on the selected element. Modify this new element according to your needs, as described in step 3. -
How to delete already named elements: Select one or more elements and press the Del-key.
Alternative: Select the command Delete in the context menu.
You select multiple elements by holding down the Ctrl-key or Shift-key while clicking on multiple elements. -
Close the enum-editor and accept all changes by clicking OK.
If you want to close the enum-editor and discard the changes, click Cancel.
Good to know |
---|
How to undo the most recent edit action in the enum-editor: Press Ctrl+Z (once for the last action; several times for multiple actions). How to redo the most recent undone edit action in the enum-editor: Press Ctrl+Y (once for the last action; several times for multiple actions).
When entering an invalid initial value for the entire declaration or name/value for the named element, you can recognize errors due to the icon in front of the entire initial value, name or value. If you move the mouse cursor over the icon, you will get more detailed information about the error. In case of warnings or errors that relate to the entire enum, the corresponding message is displayed below the list with the named elements.
The initial value for the entire declaration and the values for the named elements might be a →constant expression.
|
Restrictions
|