Syntax for User-Defined Enumerations

Use PowerScript to create custom enumerations for PowerBuilder .NET targets.

This example creates a user-defined enumeration named MyEnum:
                global type MyEnum enumerated
                    item1, 
                    item2 = 3
                end type
The syntax to access an enumeration constant is:
     [[namespacename.]enumerationType.]enumerationEntryName! 
Use the enumeration type to access the items of user-defined enumerations. For example:
                Enum me
                me = MyEnum.item2!

This syntax helps make the code readable and avoids naming conflicts.

If you do not provide an enumeration type, the enumeration is assumed to be a system-defined type and PowerBuilder .NET tries to find it in PowerBuilder system-defined enumerations. If the enumeration type exists, PowerBuilder .NET tries to find the enumeration type first and then find the entry for that enumeration type.

Related tasks
Creating a Local User-Defined Enumeration