About the Enumeration Painter

The Enumeration painter is similar to the Structure painter. You can use the painter to define global enumerations for your applications or components, and object painters to define local enumerations for objects in your applications or components.

Each row in the Enumeration painter represents an item in the enumeration you are defining. The rows contain editable text cells under three columns: Name, Value, and Comments. Specify a name for each item to include in the enumeration. Enumeration values must be whole numbers.

If you select the Flags option in the Enumeration painter, the values for each item in the enumeration are treated as bit fields.

The Enumeration painter for local enumerations includes the Enumeration Name field, where you enter the name for the local enumeration. This field does not appear in the painter for global enumerations, as a global enumeration is saved as a file when you select File > Save. The extension for a global user-defined enumeration that you save in the Enumeration painter is .sre.

System.Enum is the base class for all PowerBuilder .NET enumerations. You can assign enumerations using System.Enum, System.Object, ANY, or integral (int, unit, byte, sbyte, long, ulong, longlong, and ulonglong) datatypes.

For example, the following code assigns an integer to an enumeration named "myenum":
    int a = 1
    myenum e
    e=a

When the Enumeration painter is active, its context menu includes Insert Field and Delete Field menu items. Insert Field adds an empty row before the current row and the sequential values in the rows after the empty row are automatically adjusted upwards. Delete Field removes the current row and the values in the rows following the deleted row are adjusted downwards sequentially.